8000 Require u:locale option to be set by a literal value by eemeli · Pull Request #1017 · unicode-org/message-format-wg · GitHub
[go: up one dir, main page]

Skip to content

Require u:locale option to be set by a literal value #1017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 5 additions & 0 deletions spec/u-namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ well-formed [BCP 47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
language tags,
or an implementation-defined list of such tags.

The value of this _option_ MUST be set by a _literal_.
If this value is set by a _variable_ or
the option value of an implementation-defined type used as an _operand_,
a _Bad Option Error_ is emitted and the value is ignored.

If this _option_ is set on _markup_, a _Bad Option_ error is emitted
and the value of the `u:locale` _option_ is ignored.

Expand Down
16 changes: 16 additions & 0 deletions test/tests/u-options.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@
"src": "hello {4.2 :number u:locale=fr}",
"exp": "hello 4,2"
},
{
"src": "hello {4.2 :number u:locale=$bad}",
"params": [{"name": "bad", "value": "fr"}],
"expErrors": [{ "type": "bad-option" }],
"exp": "hello 4.2"
},
{
"src": ".local $good = {4.2 :number u:locale=fr} {{hello {$good}}}",
"exp": "hello 4,2"
},
{
"src": ".local $bad = {4.2 :number u:locale=fr} {{hello {$bad :number}}}",
"params": [{"name": "bad", "value": "fr"}],
"expErrors": [{ "type": "bad-option" }],
"exp": "hello 4.2"
},
{
"src": "hello {world :string u:dir=ltr u:id=foo}",
"exp": "hello \u2066world\u2069",
Expand Down
0