feat(plugins): add useLocaleMessage to plugins #147
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR adds the hook
useLocaleMessage
to the pluginApi to fetch the locale messages for the internationalization of the plugins.Motivation
Add internationalization for the plugins more easily as requested in the issue bigbluebutton/plugin-typed-captions#6
How to test
To test this, there ar 3 PRs that work together here: This one in the CORE, the one in the SDK, mentioned ahead and the one in the typed-captions (which will be sent later on), so the 3 of them must be tested at the same time.
Go into the
webpack.config.js
file in the plugin, and write:Into the
devServer
directive (If that's not there yet).Then into the file
src/components/main/component.tsx
search for the hook used to obtain the intl-messages that ispluginApi.useLocaleMessages
and add the following argument to the function:With that, the ngrok will not complain about the locale files and everything should flow normally.
More
Closely related to the PR in the CORE bigbluebutton/bigbluebutton#22269
See demo of this feature:
plugin_locales.mp4