|
| 1 | +# MessageFormat 2.0 Unicode Registry |
| 2 | + |
| 3 | +The `u:` namespace is reserved for use by the Unicode Consortium. |
| 4 | + |
| 5 | +## Options |
| 6 | + |
| 7 | +This section describes common options which each implementation SHOULD support |
| 8 | +for all _functions_ and _markup_. |
| 9 | + |
| 10 | +### `u:id` |
| 11 | + |
| 12 | +A string value that is included as an `id` or other suitable value |
| 13 | +in the formatted parts for the _placeholder_, |
| 14 | +or any other structured formatted results. |
| 15 | + |
| 16 | +Ignored when formatting a message to a string. |
| 17 | + |
| 18 | +Accepts string values, or values which can be stringified without error. |
| 19 | +For other values, a _Bad Option_ error is emitted |
| 20 | +and the `u:id` option is ignored. |
| 21 | + |
| 22 | +### `u:locale` |
| 23 | + |
| 24 | +A comma-delimited list of BCP 47 language tags, |
| 25 | +or an implementation-defined list of such tags. |
| 26 | + |
| 27 | +Replaces the _locale_ defined in the _function context_ for this _expression_. |
| 28 | +The value is ignored when set on _markup_. |
| 29 | + |
| 30 | +During processing, the `u:locale` option |
| 31 | +is always removed from the resolved mapping of _options_. |
| 32 | + |
| 33 | +Values matching the following ABNF are always accepted: |
| 34 | +```abnf |
| 35 | +u-locale-option = langtag *([s] "," [s] langtag) |
| 36 | +``` |
| 37 | +using `langtag` as defined in [RFC 5646](https://www.rfc-editor.org/rfc/rfc5646). |
| 38 | + |
| 39 | +Implementations MAY support additional language tags, |
| 40 | +such as private-use or grandfathered tags, |
| 41 | +or tags using `_` instead of `-` as a separator. |
| 42 | +When the value of `u:locale` is set by a _variable_, |
| 43 | +implementations MAY support non-string values otherwise representing locales. |
| 44 | + |
| 45 | +For unsupported values, a _Bad Option_ error is emitted |
| 46 | +and the value of the `u:locale` option is ignored. |
| 47 | + |
| 48 | +### `u:dir` |
| 49 | + |
| 50 | +Replaces the base directionality defined in |
| 51 | +the _function context_ for this _expression_. |
| 52 | +The value is ignored when set on _markup_. |
| 53 | + |
| 54 | +During processing, the `u:dir` option |
| 55 | +is always removed from the resolved mapping of _options_. |
| 56 | + |
| 57 | +Accepts the following string values: |
| 58 | +- `ltr`: left-to-right directionality |
| 59 | +- `rtl`: right-to-left directionality |
| 60 | +- `auto`: directionality determined from _expression_ contents |
| 61 | + |
| 62 | +For other values, a _Bad Option_ error is emitted |
| 63 | +and the value of the `u:dir` option is ignored. |
0 commit comments