From 43cdf1a1e241157212136cf2c66c867cb04a98c8 Mon Sep 17 00:00:00 2001 From: Richard Bloor Date: Mon, 7 Apr 2025 20:50:14 +1200 Subject: [PATCH 1/6] Bug-1381580 cascading locales support release note --- files/en-us/mozilla/firefox/releases/139/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/en-us/mozilla/firefox/releases/139/index.md b/files/en-us/mozilla/firefox/releases/139/index.md index b0857f9d744a2ba..877a4846ce01682 100644 --- a/files/en-us/mozilla/firefox/releases/139/index.md +++ b/files/en-us/mozilla/firefox/releases/139/index.md @@ -58,6 +58,8 @@ Firefox 139 is the current [Nightly version of Firefox](https://www.mozilla.org/ ## Changes for add-on developers +- Localized extensions now provide for cascading from a region to a language and then extension default. Previously, if a translation couldn't be found for a region, the extension reverted to the extension default. Take an extension with the default of Spanish (`es`) and a translation for English (`en`) installed by a user who has chosen British English (`en-GB`) as their browser locale. Previously, the user was served the default (Spanish) translation. After this change, the user is served the English (`en`) translation. ([Firefox bug 1381580](https://bugzil.la/1381580)) + ### Removals ### Other From f7c218cf7e389cde3c3c1b92eea42183090fc4de Mon Sep 17 00:00:00 2001 From: rebloor Date: Tue, 8 Apr 2025 03:40:11 +1200 Subject: [PATCH 2/6] Update for review feedback --- files/en-us/mozilla/firefox/releases/139/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/mozilla/firefox/releases/139/index.md b/files/en-us/mozilla/firefox/releases/139/index.md index 877a4846ce01682..7095e60ae9c4e8c 100644 --- a/files/en-us/mozilla/firefox/releases/139/index.md +++ b/files/en-us/mozilla/firefox/releases/139/index.md @@ -58,7 +58,7 @@ Firefox 139 is the current [Nightly version of Firefox](https://www.mozilla.org/ ## Changes for add-on developers -- Localized extensions now provide for cascading from a region to a language and then extension default. Previously, if a translation couldn't be found for a region, the extension reverted to the extension default. Take an extension with the default of Spanish (`es`) and a translation for English (`en`) installed by a user who has chosen British English (`en-GB`) as their browser locale. Previously, the user was served the default (Spanish) translation. After this change, the user is served the English (`en`) translation. ([Firefox bug 1381580](https://bugzil.la/1381580)) +- Localized extensions now cascade through locale subtags to find translations before reverting to the extension's default language. Previously, the extension used the extension default if a translation couldn't be found for a language with subtags (such as `en-GB` or `zh-Hans-CN`). Take an extension with the default of Spanish (`es`) and a translation for English (`en`) installed by a user who has chosen British English (`en-GB`) as their browser locale. Previously, the user was served the default (Spanish) translation. After this change, the user is served the English (`en`) translation. ([Firefox bug 1381580](https://bugzil.la/1381580)) ### Removals From be547bf49d3eed603dd6e2a5a6d5a1e24913c50f Mon Sep 17 00:00:00 2001 From: Richard Bloor Date: Tue, 8 Apr 2025 04:26:57 +1200 Subject: [PATCH 3/6] Clarification to "Localized string selection" --- .../webextensions/internationalization/index.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md b/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md index ed974e6254a576f..f29a9d61a21667f 100644 --- a/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md @@ -225,14 +225,14 @@ In addition, you can use such substitutions to specify parts of the string that ## Localized string selection -Locales can be specified using only a language code, like `fr` or `en`, or they may be further qualified with a region code, like `en_US` or `en_GB`, which describes a regional variant of the same basic language. When you ask the i18n system for a string, it will select a string using the following algorithm: +Locales can be specified using a language code, such as `fr` or `en` or qualified with a script and region code, such as `en_US` or `zh-Hans-CN`. When your extension asks the i18n system for a string, it selects a string using this algorithm: -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.` 3. Otherwise, if there is a `messages.json` file for the `default_locale` defined in the `manifest.json`, and it contains the string, return it. 4. Otherwise return an empty string. -Take the following example: +Take this example: - extension-root-directory/ @@ -256,10 +256,11 @@ Take the following example: - `{ "colorLocalized": { "message": "couleur", "description": "Color." }, /* … */}` -Suppose the `default_locale` is set to `fr`, and the browser's current locale is `en_GB`: +Suppose the `default_locale` is set to `fr`. -- If the extension calls `getMessage("colorLocalized")`, it will return "colour". -- If "colorLocalized" were not present in `en_GB`, then `getMessage("colorLocalized")`, would return "color", not "couleur". +- If the browser's locale is `en_GB` when the extension calls `getMessage("colorLocalized")`, it is returned "colour" because `en_GB` has a matching locale. +- If the browser's locale is `en_US` when the extension calls `getMessage("colorLocalized")`, it is returned "color" because it matches to the `en` locale. +- If the browser's locale is `zh-Hans-CN` when the extension calls `getMessage("colorLocalized")`, it is returned "couleur" because there is no language, script, or region match to the `zh-Hans-CN` locale. ## Predefined messages From 577a4e14f2265fe8d9d3709f1d33d8e4cdcf65d5 Mon Sep 17 00:00:00 2001 From: rebloor Date: Tue, 8 Apr 2025 14:46:41 +1200 Subject: [PATCH 4/6] Apply suggestions from review Co-authored-by: carlosjeurissen <1038267+carlosjeurissen@users.noreply.github.com> --- .../add-ons/webextensions/internationalization/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md b/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md index f29a9d61a21667f..8d874a04a1f88fc 100644 --- a/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md @@ -227,7 +227,7 @@ In addition, you can use such substitutions to specify parts of the string that Locales can be specified using a language code, such as `fr` or `en` or qualified with a script and region code, such as `en_US` or `zh-Hans-CN`. When your extension asks the i18n system for a string, it selects a string using this algorithm: -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. +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 the `_locales/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.` 3. Otherwise, if there is a `messages.json` file for the `default_locale` defined in the `manifest.json`, and it contains the string, return it. 4. Otherwise return an empty string. @@ -258,8 +258,8 @@ Take this example: Suppose the `default_locale` is set to `fr`. -- If the browser's locale is `en_GB` when the extension calls `getMessage("colorLocalized")`, it is returned "colour" because `en_GB` has a matching locale. -- If the browser's locale is `en_US` when the extension calls `getMessage("colorLocalized")`, it is returned "color" because it matches to the `en` locale. +- If the browser's locale is `en-GB` when the extension calls `getMessage("colorLocalized")`, it is returned "colour" because `_locales/en_GB/messages.json` contains the colorLocalized message. +- If the browser's locale is `en-US` when the extension calls `getMessage("colorLocalized")`, it returns "color" because it falls back to the message present in `_locales/en/messages.json`. - If the browser's locale is `zh-Hans-CN` when the extension calls `getMessage("colorLocalized")`, it is returned "couleur" because there is no language, script, or region match to the `zh-Hans-CN` locale. ## Predefined messages From 5d01502e62d7fe9a3dd5fbf7b8f36035c24fc102 Mon Sep 17 00:00:00 2001 From: Richard Bloor Date: Tue, 8 Apr 2025 14:53:09 +1200 Subject: [PATCH 5/6] Minor fixes --- .../add-ons/webextensions/internationalization/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md b/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md index 8d874a04a1f88fc..e7c0da5084162b7 100644 --- a/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md @@ -225,10 +225,10 @@ In addition, you can use such substitutions to specify parts of the string that ## Localized string selection -Locales can be specified using a language code, such as `fr` or `en` or qualified with a script and region code, such as `en_US` or `zh-Hans-CN`. When your extension asks the i18n system for a string, it selects a string using this algorithm: +Locales can be specified using a language code, such as `fr` or `en` or qualified with a script and region code, such as `en-US` or `zh-Hans-CN`. When your extension asks the i18n system for a string, it selects a string using this algorithm: 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 the `_locales/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.` +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`(and there is no `_locales/zh_Hans_CN/messages.json` file) the i18n system looks for a string in `zh-Hans`, and if that isn't available, `zh.` 3. Otherwise, if there is a `messages.json` file for the `default_locale` defined in the `manifest.json`, and it contains the string, return it. 4. Otherwise return an empty string. @@ -258,8 +258,8 @@ Take this example: Suppose the `default_locale` is set to `fr`. -- If the browser's locale is `en-GB` when the extension calls `getMessage("colorLocalized")`, it is returned "colour" because `_locales/en_GB/messages.json` contains the colorLocalized message. -- If the browser's locale is `en-US` when the extension calls `getMessage("colorLocalized")`, it returns "color" because it falls back to the message present in `_locales/en/messages.json`. +- If the browser's locale is `en-GB` when the extension calls `getMessage("colorLocalized")`, it is returned "colour" because `_locales/en_GB/messages.json` contains the `colorLocalized` message. +- If the browser's locale is `en-US` when the extension calls `getMessage("colorLocalized")`, it is returned "color" because it falls back to the message present in `_locales/en/messages.json`. - If the browser's locale is `zh-Hans-CN` when the extension calls `getMessage("colorLocalized")`, it is returned "couleur" because there is no language, script, or region match to the `zh-Hans-CN` locale. ## Predefined messages From 37431ec6f5880004e2c599a65c98aa505462a7ab Mon Sep 17 00:00:00 2001 From: Richard Bloor Date: Fri, 18 Apr 2025 12:04:20 +1200 Subject: [PATCH 6/6] Remove release notes --- .../mozilla/firefox/releases/139/index.md | 75 ------------------- 1 file changed, 75 deletions(-) delete mode 100644 files/en-us/mozilla/firefox/releases/139/index.md diff --git a/files/en-us/mozilla/firefox/releases/139/index.md b/files/en-us/mozilla/firefox/releases/139/index.md deleted file mode 100644 index 7095e60ae9c4e8c..000000000000000 --- a/files/en-us/mozilla/firefox/releases/139/index.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Firefox 139 for developers -slug: Mozilla/Firefox/Releases/139 -page-type: firefox-release-notes -sidebar: firefoxsidebar ---- - -This article provides information about the changes in Firefox 139 that affect developers. -Firefox 139 is the current [Nightly version of Firefox](https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly) and ships on [May 27, 2025](https://whattrainisitnow.com/release/?version=139). - -## Changes for web developers - -### Developer Tools - -### HTML - -#### Removals - -### CSS - -#### Removals - -### JavaScript - -#### Removals - -### SVG - -#### Removals - -### HTTP - -#### Removals - -### Security - -#### Removals - -### APIs - -#### DOM - -#### Media, WebRTC, and Web Audio - -#### Removals - -### WebAssembly - -#### Removals - -### WebDriver conformance (WebDriver BiDi, Marionette) - -#### General - -#### WebDriver BiDi - -#### Marionette - -## Changes for add-on developers - -- Localized extensions now cascade through locale subtags to find translations before reverting to the extension's default language. Previously, the extension used the extension default if a translation couldn't be found for a language with subtags (such as `en-GB` or `zh-Hans-CN`). Take an extension with the default of Spanish (`es`) and a translation for English (`en`) installed by a user who has chosen British English (`en-GB`) as their browser locale. Previously, the user was served the default (Spanish) translation. After this change, the user is served the English (`en`) translation. ([Firefox bug 1381580](https://bugzil.la/1381580)) - -### Removals - -### Other - -## Experimental web features - -These features are newly shipped in Firefox 139 but are disabled by default. -To experiment with them, search for the appropriate preference on the `about:config` page and set it to `true`. -You can find more such features on the [Experimental features](/en-US/docs/Mozilla/Firefox/Experimental_features) page. - -## Older versions - -{{Firefox_for_developers}}