From f843a299554e4718f0b82f8ff1429d3b216998a4 Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Mon, 17 Feb 2025 15:13:19 +0200 Subject: [PATCH 1/4] Define optionality separately for each u: option --- spec/u-namespace.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/u-namespace.md b/spec/u-namespace.md index 5eb04db8bc..2dc8ddafa8 100644 --- a/spec/u-namespace.md +++ b/spec/u-namespace.md @@ -12,11 +12,14 @@ manages the specification for this namespace, hence the _namespace_ `u:`. ## Options -This section describes common **_`u:` options_** which each implementation SHOULD support +This section describes common **_`u:` options_** that apply for all _functions_ and _markup_. ### `u:id` +Implementations providing a formatting target other than a concatenated string +SHOULD support this option. + A string value that is included as an `id` or other suitable value in the formatted parts for the _placeholder_, or any other structured formatted results. @@ -31,6 +34,8 @@ and the `u:id` option is ignored. ### `u:locale` +Implementations MAY support this option. + Replaces the _locale_ defined in the _function context_ for this _expression_. A comma-delimited list consisting of @@ -67,6 +72,8 @@ not valid, or some other reason. ### `u:dir` +Implementations SHOULD support this option. + Replaces the base directionality defined in the _function context_ for this _expression_ and applies bidirectional isolation to it. From ca960d030d7ee33ea10803a243c31ba46efa2881 Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Mon, 17 Feb 2025 17:38:53 +0200 Subject: [PATCH 2/4] Rephrase options intro Co-authored-by: Addison Phillips --- spec/u-namespace.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/u-namespace.md b/spec/u-namespace.md index 2dc8ddafa8..904aaa6f39 100644 --- a/spec/u-namespace.md +++ b/spec/u-namespace.md @@ -12,8 +12,9 @@ manages the specification for this namespace, hence the _namespace_ `u:`. ## Options -This section describes common **_`u:` options_** that apply -for all _functions_ and _markup_. +This section describes **_`u:` options_**. +When implemented, they apply to all _functions_ and _markup_, +including user-defined _functions_ in that implementation. ### `u:id` From 3f5064e23160249471542a7a5f3bb30546557aeb Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Mon, 17 Feb 2025 17:43:09 +0200 Subject: [PATCH 3/4] Add u:id example --- spec/u-namespace.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/u-namespace.md b/spec/u-namespace.md index 904aaa6f39..d2ab15d851 100644 --- a/spec/u-namespace.md +++ b/spec/u-namespace.md @@ -25,6 +25,13 @@ A string value that is included as an `id` or other suitable value in the formatted parts for the _placeholder_, or any other structured formatted results. +> For example, `u:id` could be used to distinguish +> two otherwise matching placeholders from each other: +> +> ``` +> The first number was {$a :number u:id=first} and the second {$b :number u:id=second}. +> ``` + Ignored when formatting a message to a string. The value of the `u:id` _option_ MUST be a _literal_ or a From 1cf6ac02b35d739781a634cd2d40c8e8b214f46a Mon Sep 17 00:00:00 2001 From: Addison Phillips Date: Mon, 17 Feb 2025 11:41:39 -0800 Subject: [PATCH 4/4] Make u:locale have status Draft --- spec/u-namespace.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/u-namespace.md b/spec/u-namespace.md index d2ab15d851..accabf6d9c 100644 --- a/spec/u-namespace.md +++ b/spec/u-namespace.md @@ -1,4 +1,4 @@ -# MessageFormat 2.0 Unicode Namespace +# MessageFormat Unicode Namespace The `u:` _namespace_ is reserved for the definition of _options_ which affect the _function context_ of the specific _expressions_ @@ -42,6 +42,10 @@ and the `u:id` option is ignored. ### `u:locale` +> [!IMPORTANT] +> This _option_ has a status of **Draft**. +> It is proposed for inclusion in a future release and is not Stable. + Implementations MAY support this option. Replaces the _locale_ defined in the _function context_ for this _expression_.