Repository navigation
fix: locale issues - #21408
fix: locale issues#21408
Conversation
WalkthroughThe changes in this pull request focus on improving internationalization handling within two components: In the Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
bigbluebutton-html5/imports/startup/client/intlAdapter.tsx (2)
Line range hint
115-126: Improved locale update handlingThe changes in
runOnCurrentLocaleUpdateare beneficial:
- Calling
sendUiDataToPlugins()immediately aftersetUp()ensures that plugins receive updated UI data as soon as the locale changes.- Removing and re-adding the event listener prevents potential issues with stale listeners.
These modifications should help address the locale-related issues mentioned in the PR objectives, particularly for UI elements like tooltips and toast notifications.
Consider using the
AbortControllerAPI for more efficient event listener management:const runOnCurrentLocaleUpdate = () => { const controller = new AbortController(); setUp(); sendUiDataToPlugins(); window.addEventListener( `${UI_DATA_LISTENER_SUBSCRIBED}-${PluginSdk.IntlLocaleUiDataNames.CURRENT_LOCALE}`, sendUiDataToPlugins, { signal: controller.signal } ); return () => controller.abort(); }; useEffect(() => { const cleanup = runOnCurrentLocaleUpdate(); return cleanup; }, [currentLocale]);This approach simplifies the cleanup process and avoids the need for explicit
removeEventListenercalls.
Automated tests Summary✅ All the CI tests have passed! |



What does this PR do?
fix:
How to test
for item 1:
for item 2: