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

fix: i18n bundle storage #10924

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix: i18n bundle storage #10924

wants to merge 1 commit into from

Conversation

nnaydenow
Copy link
Contributor

@nnaydenow nnaydenow commented Feb 21, 2025

With the introduction of i18n storage, all loaded bundles are now stored within UI5Element (PR #10521). This storage mechanism allows child components of a UI5Element to share localization data, but the final stored bundle depends on which component loads its bundle last.

Example:

class Example extends UI5Element {
  @i18n("@ui5/webcomponents")
  static i18nBundle: I18nBundle;
}

class Example2 extends UI5Element {
  @i18n("@ui5/webcomponents-fiori")
  static i18nBundle: I18nBundle;
}

Previously, when accessing i18nBundle, the storage would always return @ui5/webcomponents-fiori, since bundles were stored under a shared key, leading to overwrites.

With this change, bundles are now stored with their bundle names. As a result:

  • Example2.i18nBundle will correctly access the @ui5/webcomponents-fiori bundle.
  • Example.i18nBundle will correctly access the @ui5/webcomponents bundle.

This ensures that each component retrieves the correct localization data.

Fixes: #10808

@nnaydenow nnaydenow requested a review from vladitasev February 21, 2025 12:27
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.

[ShellBar]: [i18n warning after upgrade to 2.7.1]
2 participants