-
Notifications
You must be signed in to change notification settings - Fork 22.7k
Bug-1381580 cascading locales support release note #39013
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
base: main
Are you sure you want to change the base?
Conversation
Preview URLs
External URLs (3)URL:
(comment last updated: 2025-04-12 16:25:58) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 from me, tnx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggesting to use properly formatted bcp-47 language tags when possible as this is the default for web.
files/en-us/mozilla/add-ons/webextensions/internationalization/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mozilla/add-ons/webextensions/internationalization/index.md
Outdated
Show resolved
Hide resolved
1. if there is a `messages.json` file for the exact current locale, and it contains the string, return it. | ||
2. Otherwise, if the current locale is qualified with a region (e.g., `en_US`) and there is a `messages.json` file for the regionless version of that locale (e.g., `en`), and that file contains the string, return it. | ||
1. Return the string if there is a `messages.json` file for the user's set browser locale containing the string. For example, if the user has set their browser to `en_US` and the extension provides an `en_US` `messages.json` file. | ||
2. Otherwise, if the browser locale is qualified with a script or region (e.g., `en_US` or `zh-Hans-CN`) and there is a `messages.json` file for the regionless version and failing that the scriptless version of that locale and that file contains the string, return it. For example, if the user has set their browser to `zh-Hans-CN`, the i18n system looks for a string in `zh-Hans`, and if that isn't available, `zh.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Otherwise, if the browser locale is qualified with a script or region (e.g., `en_US` or `zh-Hans-CN`) and there is a `messages.json` file for the regionless version and failing that the scriptless version of that locale and that file contains the string, return it. For example, if the user has set their browser to `zh-Hans-CN`, the i18n system looks for a string in `zh-Hans`, and if that isn't available, `zh.` | |
2. Otherwise, if the browser locale is qualified with a script or region (e.g., `en_US` or `zh-Hans-CN`) and there is a `messages.json` file for the regionless version and failing that the scriptless version of that locale and that file contains the string, return it. For example, if the user has set their browser to `zh-Hans-CN`, the i18n system looks for a string in `zh_Hans-CN`, if unavailable, look for `zh_Hans`, and if that isn't available, `zh.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@carlosjeurissen given that we've already covered the case of an exact match between the browser's set language and a locale file in point 1, I've rephrased this for clarity.
files/en-us/mozilla/add-ons/webextensions/internationalization/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: carlosjeurissen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request has merge conflicts that must be resolved before it can be merged. |
@pepelsbey - this PR is targeting |
…multiple-locales-fallbacks # Conflicts: # files/en-us/mozilla/firefox/releases/139/index.md
@bsmth can I clarify your comment
Also, is everything OK with the 139 release notes? I got a merge conflict, and on checking, despite the fact that you appeared to have merged it earlier, it isn't listed in the source and now appears to be indicated as added in this PR. |
@rebloor was surprised to see the same. However when checking file changes since all commits, only the PR changes appear. |
According to the page commits, it was created by Brian https://github.com/mdn/content/commits/a56169ec1548a24c8d946773b6a645d4726ed74a/files/en-us/mozilla/firefox/releases/139/index.md |
Description
Provides a release note for Bug 1381580 "Support multiple fallback locales in i18n API". This change amended the way that localized extensions identified a translation string by cascading through region, language, and then extension default.