Skip to content

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

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 dotproto and Rob--W 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
Copy link
Contributor

github-actions bot commented Apr 7, 2025

Preview URLs

External URLs (3)

URL: /en-US/docs/Mozilla/Firefox/Releases/139
Title: Firefox 139 for developers

(comment last updated: 2025-04-12 16:25:58)

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
@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
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Firefox Content in the Mozilla/Firefox subtree Content:WebExt WebExtensions docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants