diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml index f8ce1591977bc3c..3dfd3f11b3eca57 100644 --- a/.github/workflows/pr-labeler.yml +++ b/.github/workflows/pr-labeler.yml @@ -19,7 +19,7 @@ jobs: name: Label by path runs-on: ubuntu-latest steps: - - uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1 + - uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" sync-labels: true diff --git a/files/en-us/learn_web_development/getting_started/soft_skills/finding_a_job/index.md b/files/en-us/learn_web_development/getting_started/soft_skills/finding_a_job/index.md index b10bbf7b9411cc6..30487b987b5d053 100644 --- a/files/en-us/learn_web_development/getting_started/soft_skills/finding_a_job/index.md +++ b/files/en-us/learn_web_development/getting_started/soft_skills/finding_a_job/index.md @@ -322,6 +322,6 @@ Be patient. Even the best candidates will get rejections from multiple job appli - [Getting hired](https://scrimba.com/the-frontend-developer-career-path-c0j/~0156?via=mdn), Scrimba Course Partner - [Technical Interviewing 101: Ultimate Guide to Acing Your Tech Interview](https://learntocodewith.me/posts/technical-interview/), learntocodewith.me (2022) - [30 Technical Interview Questions and Tips for Answering](https://www.coursera.org/articles/technical-interview-questions), Coursera (2023) -- [How to land your first developer job](/en-US/blog/how-to-land-your-first-developer-job), MDN Blog, 2024 +- [How to land your first developer job](/en-US/blog/how-to-land-your-first-developer-job/), MDN Blog, 2024 {{PreviousMenuNext("Learn_web_development/Getting_started/Soft_skills/Workflows_and_processes", "Learn_web_development/Core", "Learn_web_development/Getting_started/Soft_skills")}} 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 5fcb0585c700c12..60d13b1578b82fa 100644 --- a/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/internationalization/index.md @@ -215,12 +215,14 @@ 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 are specified using a language code, such as `fr` or `en`, that can be qualified with a script and region code, such as `en-US` or `zh-Hans-CN`. When your extension asks for a localized string, the i18n system returns the string from the `messages.json` files using this order of precedence: -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` (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. +1. The file for the user's browser locale, e.g., `zh-Hans-CN`. +2. If the browser locale is qualified with a script or region, the file for the regionless version, e.g., `zh-Hans`. +3. If the browser locale is qualified with a script or region, the file for the scriptless version, e.g., `zh`. +4. The file for the `default_locale` defined in the `manifest.json` file. + +If the requested string is not present in any of those files, an empty string is returned. Take this example: @@ -233,16 +235,26 @@ Take this example: en - messages.json - `{ "colorLocalized": { "message": "color", "description": "Color." }, /* … */ }` + - `{ "colorBlue": { "message": "Blue", "description": "Blue." }, /* … */ }` - fr - messages.json - `{ "colorLocalized": { "message": "couleur", "description": "Color." }, /* … */}` + - `{ "colorBlue": { "message": "Bleu", "description": "Blue." }, /* … */ }` + +With the `default_locale` set to `fr`. -Suppose the `default_locale` is set to `fr`. +- If the browser's locale is `en-GB`: + - `getMessage("colorLocalized")` returns "colour" because `_locales/en_GB/messages.json` contains the `colorLocalized` message. + - `getMessage("colorBlue")`, returns "blue" because it falls back to the `colorBlue` message in `_locales/en/messages.json`. +- If the browser's locale is `en-US`: + - `getMessage("colorLocalized")` returns "color" because there is no `_locales/en_US/messages.json` file, so it falls back to the message present in `_locales/en/messages.json`. + - `getMessage("colorBlue")` returns "blue" because it falls back to the `colorBlue` message in `_locales/en/messages.json`. +- If the browser's locale is `zh-Hans-CN`: + - `getMessage("colorLocalized")` returns "couleur" because there is no region, script, or language match to the `zh-Hans-CN` locale (i.e., no `messages.json` file in a `zh-Hans-CN`, `zh-Hans`, or`zh` folder). + - `getMessage("colorBlue")` returns "bleu" because there is no region, script, or language match to the `zh-Hans-CN` 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 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. +If the extension were to call `getMessage("colorRed")` it's returned an empty string, as there is no property for `"colorRed"` in any of the language files. ## Predefined messages diff --git a/files/en-us/mozilla/add-ons/webextensions/manifest.json/default_locale/index.md b/files/en-us/mozilla/add-ons/webextensions/manifest.json/default_locale/index.md index b74434e8f2a42d3..071f7f9ba71af93 100644 --- a/files/en-us/mozilla/add-ons/webextensions/manifest.json/default_locale/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/manifest.json/default_locale/index.md @@ -15,7 +15,7 @@ sidebar: addonsidebar
_locales subdirectory is present,
must be absent otherwise.