Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugins): add useLocaleMessage to plugins #147

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

GuiLeme
Copy link
Collaborator

@GuiLeme GuiLeme commented Feb 12, 2025

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.

  • First, one will have to apply the SDK manually into the plugin-typed-captions (Considering both in the correct branches);
  • Run in dev mode;
  • So as we are testing it with ngrok, they put some barriers there to avoid security breaches, so to properly make the testing work, do the following:

Go into the webpack.config.js file in the plugin, and write:

headers: {
      'Access-Control-Allow-Origin': '*',
      'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
      'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization, ngrok-skip-browser-warning', 
    },

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 is pluginApi.useLocaleMessages and add the following argument to the function:

{
    headers: {
      'ngrok-skip-browser-warning': 'any',
    },
  }

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant