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

Change the locale dynamically by adding &i18n-locale to URL #7686

Merged
merged 5 commits into from
Aug 15, 2024

Commits on Aug 12, 2024

  1. Change the locale dynamically by adding &i18n-locale to URL

    The main issue was the inability to dynamically change the locale in OpenSearch
    Dashboards. Currently we need to update config file and i18nrc.json.
    
    This PR allows  users to switch to a different locale (e.g., from English to Chinese)
    by appending or modifying the 'i18n-locale' parameter in the URL.
    
    * getAndUpdateLocaleInUrl: If a non-default locale is found, this function reconstructs
    the URL with the locale parameter in the correct position.
    * updated the ScopedHistory class, allowing it to detect locale changes and trigger reloads
    as necessary.
    * modify the i18nMixin, which sets up the i18n system during server startup, to register
    all available translation files during server startup, not just the current locale.
    * update the uiRenderMixin to accept requests for any registered locale and dynamically
    load and cache translations for requested locales.
    
    Signed-off-by: Anan Zhuang <ananzh@amazon.com>
    ananzh committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    8a0ff79 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2024

  1. fix PR comments

    Signed-off-by: Anan Zhuang <ananzh@amazon.com>
    ananzh committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    4fb00b2 View commit details
    Browse the repository at this point in the history
  2. fix comments 2

    Signed-off-by: Anan Zhuang <ananzh@amazon.com>
    ananzh committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    2052a66 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2024

  1. fix tests

    Signed-off-by: Anan Zhuang <ananzh@amazon.com>
    ananzh committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    77eff19 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cea33d4 View commit details
    Browse the repository at this point in the history