Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sup>Course Partner</sup>
- [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")}}
Original file line number Diff line number Diff line change
Expand Up @@ -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:

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ sidebar: addonsidebar
<tr>
<th scope="row">Mandatory</th>
<td>
Contingent: must be present if the _locales subdirectory is present,
Contingent: must be present if the <code>_locales</code> subdirectory is present,
must be absent otherwise.
</td>
</tr>
Expand All @@ -26,9 +26,9 @@ sidebar: addonsidebar
</tbody>
</table>

This key must be present if the extension contains the \_locales directory, and must be absent otherwise. It identifies a subdirectory of \_locales, and this subdirectory will be used to find the default strings for your extension.
This key must be present if the extension contains the `\_locales` directory, and must be absent otherwise. It identifies a subdirectory of `\_locales` where the i18n system finds the extension's default localization strings.

See [Internationalization](/en-US/docs/Mozilla/Add-ons/WebExtensions/Internationalization).
See [Internationalization](/en-US/docs/Mozilla/Add-ons/WebExtensions/Internationalization) for more information.

## Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ sidebar: cssref

The **`caret-animation`** [CSS](/en-US/docs/Web/CSS) property is used to enable or disable the blinking behavior of the **insertion caret**, the visible marker that appears in editable elements to indicate where the next character will be inserted or deleted.

When applying a custom animation to the caret, you should stop the default blinking so that it doesn't interfere with the animation.
The `caret-animation` property can also be set as part of the {{cssxref("caret")}} shorthand property.

> [!NOTE]
> When applying a custom animation to the caret, you should stop the default blinking so that it doesn't interfere with the animation.

## Syntax

Expand Down
2 changes: 2 additions & 0 deletions files/en-us/web/css/reference/properties/caret-color/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ sidebar: cssref

The **`caret-color`** [CSS](/en-US/docs/Web/CSS) property sets the color of the **insertion caret**, sometimes referred to as the **text input cursor**. This is the visible marker appearing at the insertion point where the next character typed will be added or where the next character deleted will be removed.

The `caret-color` property can also be set as part of the {{cssxref("caret")}} shorthand property.

{{InteractiveExample("CSS Demo: caret-color")}}

```css interactive-example-choice
Expand Down
2 changes: 2 additions & 0 deletions files/en-us/web/css/reference/properties/caret-shape/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ sidebar: cssref

The **`caret-shape`** [CSS](/en-US/docs/Web/CSS) property sets the shape of the **insertion caret**, the visible marker that appears in editable elements to indicate where the next character will be inserted or deleted.

The `caret-shape` property can also be set as part of the {{cssxref("caret")}} shorthand property.

{{InteractiveExample("CSS Demo: caret-shape")}}

```css interactive-example-choice
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/svg/reference/attribute/overflow/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ browser-compat: svg.global_attributes.overflow
sidebar: svgref
---

The **`overflow`** attribute sets what to do when an element's content is too big to fit in its block formatting context. **This feature is not widely implemented yet**.
The **`overflow`** attribute sets what to do when an element's content is too big to fit in its block formatting context.

This attribute has the same parameter values and meaning as the CSS {{cssxref("overflow")}} property, however, the following additional points apply:

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"parse-diff": "^0.12.0",
"prettier": "3.8.3",
"tempy": "^3.2.0",
"yaml": "^2.8.4",
"yaml": "^2.9.0",
"yargs": "^18.0.0"
}
}