Skip to content

Editorial: Relax UpdateLanguageId language tag constraints from "canonical" to "structurally valid" #1008

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Editorial: Relax UpdateLanguageId language tag constraints from "cano…
…nical" to "structurally valid"

Canonicalization is already performed by MakeLocaleRecord, and not needed before it.
  • Loading branch information
gibson042 committed May 30, 2025
commit f974b4068bfecacfd37fa0cb7217df9f01c35518
7 changes: 3 additions & 4 deletions spec/locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ <h1>Intl.Locale ( _tag_ [ , _options_ ] )</h1>
1. Let _tag_ be ? ToString(_tag_).
1. Set _options_ to ? CoerceOptionsToObject(_options_).
1. If IsStructurallyValidLanguageTag(_tag_) is *false*, throw a *RangeError* exception.
1. Set _tag_ to CanonicalizeUnicodeLocaleId(_tag_).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing canonicalisation is still a normative change: #804 (review)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All right, that's twice now... this is clearly too subtle, so I've added an explanatory note.

1. Set _tag_ to ? UpdateLanguageId(_tag_, _options_).
1. Let _opt_ be a new Record.
1. Let _calendar_ be ? GetOption(_options_, *"calendar"*, ~string~, ~empty~, *undefined*).
Expand Down Expand Up @@ -69,13 +68,13 @@ <h1>Intl.Locale ( _tag_ [ , _options_ ] )</h1>
<emu-clause id="sec-updatelanguageid" type="abstract operation" oldids="sec-apply-options-to-tag">
<h1>
UpdateLanguageId (
_tag_: a Unicode canonicalized locale identifier,
_tag_: a structurally valid language tag,
_options_: an Object,
): either a normal completion containing a language tag or a throw completion
): either a normal completion containing a structurally valid language tag or a throw completion
</h1>
<dl class="header">
<dt>description</dt>
<dd>It updates the <code>unicode_language_id</code> subtags in _tag_ from the corresponding properties of _options_ and returns the <emu-xref href="#sec-isstructurallyvalidlanguagetag">structurally valid</emu-xref> but non-canonicalized result.</dd>
<dd>It updates the <code>unicode_language_id</code> subtags in _tag_ from the corresponding properties of _options_, validates them, and returns the result.</dd>
</dl>
<emu-alg>
1. Let _baseName_ be GetLocaleBaseName(_tag_).
Expand Down