Skip to content

Bug-1381580 cascading locales support release note#39013

Merged
rebloor merged 8 commits intomdn:mainfrom
rebloor:Bug-1381580-multiple-locales-fallbacks
Apr 18, 2025
Merged

Bug-1381580 cascading locales support release note#39013
rebloor merged 8 commits intomdn:mainfrom
rebloor:Bug-1381580-multiple-locales-fallbacks

Conversation

@rebloor
Copy link
Contributor

@rebloor rebloor commented Apr 7, 2025

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.

@rebloor rebloor added the Content:WebExt WebExtensions docs label Apr 7, 2025
@rebloor rebloor requested review from Rob--W and dotproto April 7, 2025 08:54
@rebloor rebloor self-assigned this Apr 7, 2025
@rebloor rebloor requested a review from a team as a code owner April 7, 2025 08:54
@rebloor rebloor requested review from bsmth and removed request for a team April 7, 2025 08:54
@github-actions github-actions bot added Content:Firefox Content in the Mozilla/Firefox subtree size/xs [PR only] 0-5 LoC changed and removed Content:WebExt WebExtensions docs labels Apr 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2025

Preview URLs

(comment last updated: 2025-04-18 18:31:03)

Copy link
Member

@bsmth bsmth left a 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

@rebloor rebloor requested a review from a team as a code owner April 7, 2025 16:27
@github-actions github-actions bot added the Content:WebExt WebExtensions docs label Apr 7, 2025
@rebloor rebloor requested a review from carlosjeurissen April 7, 2025 16:27
@github-actions github-actions bot added size/s [PR only] 6-50 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels Apr 7, 2025
Copy link
Contributor

@carlosjeurissen carlosjeurissen left a 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.

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.`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.`

Copy link
Contributor Author

@rebloor rebloor Apr 8, 2025

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.

rebloor and others added 2 commits April 8, 2025 14:46
Co-authored-by: carlosjeurissen <1038267+carlosjeurissen@users.noreply.github.com>
@rebloor rebloor requested a review from carlosjeurissen April 8, 2025 02:53
Copy link
Contributor

@carlosjeurissen carlosjeurissen left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the merge conflicts 🚧 [PR only] label Apr 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2025

This pull request has merge conflicts that must be resolved before it can be merged.

@bsmth
Copy link
Member

bsmth commented Apr 11, 2025

@pepelsbey - this PR is targeting /releases/139. I believe the fix here is updating the base branch to firefox/139, correct?

…multiple-locales-fallbacks

# Conflicts:
#	files/en-us/mozilla/firefox/releases/139/index.md
@github-actions github-actions bot added size/m [PR only] 51-500 LoC changed and removed merge conflicts 🚧 [PR only] size/s [PR only] 6-50 LoC changed labels Apr 12, 2025
@rebloor
Copy link
Contributor Author

rebloor commented Apr 12, 2025

@bsmth can I clarify your comment

this PR is targeting /releases/139. I believe the fix here is updating the base branch to firefox/139, correct?

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.
image

@carlosjeurissen
Copy link
Contributor

@rebloor was surprised to see the same. However when checking file changes since all commits, only the PR changes appear.

@rebloor
Copy link
Contributor Author

rebloor commented Apr 12, 2025

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

@pepelsbey
Copy link
Member

pepelsbey commented Apr 17, 2025

@rebloor starting from the Firefox 139 release, we’ll be changing the release notes workflow a bit. We keep release notes for upcoming Firefox versions in the firefox/n branch until they are ready and merge them the day before the release. This way, among other things, we’d like to avoid half-baked pages.

Do you mind creating a separate PR with 139 release notes targeting the firefox/139 branch? The release notes file is already there.

Thank you!

Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

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

Split the 139 notes to a separate PR as requested above, and then this is good to squash and merge.

@github-actions github-actions bot added size/s [PR only] 6-50 LoC changed and removed Content:Firefox Content in the Mozilla/Firefox subtree size/m [PR only] 51-500 LoC changed labels Apr 18, 2025
@rebloor
Copy link
Contributor Author

rebloor commented Apr 18, 2025

Release notes now in #39188

@rebloor rebloor merged commit dfdfa01 into mdn:main Apr 18, 2025
8 checks passed
@rebloor rebloor deleted the Bug-1381580-multiple-locales-fallbacks branch April 18, 2025 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebExt WebExtensions docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants