Document ECMA-402's prohibition on duplicate variant subtags, both in locales overall and in locales nested in transformed_extensions #1778
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes tc39/ecma402-mdn#18 which documents the change being made in tc39/ecma402#429.
The existing text was unsuited to easily adding this restriction. I also found myself dissatisfied with the current wording, which piles up a bit too much prose in one paragraph, while not clearly delineating the possible
locales
values. I rewrote stuff to clearly explain how things all fit together.I removed use of the term "Unicode BCP 47 locale identifier". If we're imposing a no-duplicate-variants requirement in
transformed_extensions
, beyond how TR35 presently defines it, the term is imprecise. And most readers of this document won't know the term anyway. It seems simplest to use "locale identifier" to refer to a string that matches the grammar and non-grammar restrictions, then "locale" refers to either a locale identifier string or to aIntl.Locale
that wraps one.The current text uses "tag" and "subtag" and "component" indiscriminately. The tag naming was fine when this page talked about language tags. It stopped making sense when this page changed to use "Unicode BCP 47 locale identifier". I changed the text to consistently use "subtag" and never "tag" for alphanumeric letter sequences, and I used "sequence" for any sequence of subtags.
As to the actual change this PR concerns, it's debatable whether this needs to be documented. The new restriction is obscure; it's doubtful people are using
transformed_extensions
if noIntl
functionality examines it. But the restriction isn't required in UTS35 or BCP 47 yet, so we really ought say it somewhere other than just the spec.Back when this was all a wiki (so it goes), I would have just made these changes and gotten a post-hoc read-over. But I guess now everything gets a full review before it lands? I'll certainly rope in some ECMA-402 people, but having a non-domain expert look at this seems pretty desirable given this page is targeted at web developers.