Skip to content

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

Copy link
Collaborator

@JoVictorNunes JoVictorNunes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@antobinary antobinary merged commit 5cafe66 into bigbluebutton:main Feb 13, 2025
3 checks passed
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.

3 participants