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

Merged
merged 1 commit into from
Feb 24, 2025
Merged

fix: i18n bundle storage #10924

merged 1 commit into from
Feb 24, 2025

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
@nnaydenow nnaydenow merged commit e5456fb into main Feb 24, 2025
12 checks passed
@nnaydenow nnaydenow deleted the i18n-ref branch February 24, 2025 07:18
@ui5-webcomponents-bot
Copy link
Collaborator

🎉 This PR is included in version v2.8.0-rc.3 🎉

The release is available on v2.8.0-rc.3

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

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