Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d096cab

Browse files
eemeliaphillips
andauthored
Define optionality separately for each u: option (#1012)
* Define optionality separately for each u: option * Rephrase options intro Co-authored-by: Addison Phillips <[email protected]> * Add u:id example * Make u:locale have status Draft --------- Co-authored-by: Addison Phillips <[email protected]>
1 parent 8feea6c commit d096cab

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

spec/u-namespace.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MessageFormat 2.0 Unicode Namespace
1+
# MessageFormat Unicode Namespace
22

33
The `u:` _namespace_ is reserved for the definition of _options_
44
which affect the _function context_ of the specific _expressions_
@@ -12,15 +12,26 @@ manages the specification for this namespace, hence the _namespace_ `u:`.
1212

1313
## Options
1414

15-
This section describes common **_<dfn>`u:` options</dfn>_** which each implementation SHOULD support
16-
for all _functions_ and _markup_.
15+
This section describes **_<dfn>`u:` options</dfn>_**.
16+
When implemented, they apply to all _functions_ and _markup_,
17+
including user-defined _functions_ in that implementation.
1718

1819
### `u:id`
1920

21+
Implementations providing a formatting target other than a concatenated string
22+
SHOULD support this option.
23+
2024
A string value that is included as an `id` or other suitable value
2125
in the formatted parts for the _placeholder_,
2226
or any other structured formatted results.
2327

28+
> For example, `u:id` could be used to distinguish
29+
> two otherwise matching placeholders from each other:
30+
>
31+
> ```
32+
> The first number was {$a :number u:id=first} and the second {$b :number u:id=second}.
33+
> ```
34+
2435
Ignored when formatting a message to a string.
2536
2637
The value of the `u:id` _option_ MUST be a _literal_ or a
@@ -31,6 +42,12 @@ and the `u:id` option is ignored.
3142
3243
### `u:locale`
3344
45+
> [!IMPORTANT]
46+
> This _option_ has a status of **Draft**.
47+
> It is proposed for inclusion in a future release and is not Stable.
48+
49+
Implementations MAY support this option.
50+
3451
Replaces the _locale_ defined in the _function context_ for this _expression_.
3552
3653
A comma-delimited list consisting of
@@ -67,6 +84,8 @@ not valid, or some other reason.
6784

6885
### `u:dir`
6986

87+
Implementations SHOULD support this option.
88+
7089
Replaces the base directionality defined in
7190
the _function context_ for this _expression_
7291
and applies bidirectional isolation to it.

0 commit comments

Comments
 (0)