diff --git a/spec/locale.html b/spec/locale.html index 0ec91d87..a6f2de87 100644 --- a/spec/locale.html +++ b/spec/locale.html @@ -82,21 +82,22 @@
unicode_language_id
subtags in _tag_ from the corresponding properties of _options_ and returns the unicode_language_id
Unicode locale nonterminal.
- 1. Let _language_ be ? GetOption(_options_, *"language"*, ~string~, ~empty~, GetLocaleLanguage(_languageId_)).
+ 1. Let _baseName_ be GetLocaleBaseName(_tag_).
+ 1. Let _language_ be ? GetOption(_options_, *"language"*, ~string~, ~empty~, GetLocaleLanguage(_baseName_)).
1. If _language_ cannot be matched by the unicode_language_subtag
Unicode locale nonterminal, throw a *RangeError* exception.
- 1. Let _script_ be ? GetOption(_options_, *"script"*, ~string~, ~empty~, GetLocaleScript(_languageId_)).
+ 1. Let _script_ be ? GetOption(_options_, *"script"*, ~string~, ~empty~, GetLocaleScript(_baseName_)).
1. If _script_ is not *undefined*, then
1. If _script_ cannot be matched by the unicode_script_subtag
Unicode locale nonterminal, throw a *RangeError* exception.
- 1. Let _region_ be ? GetOption(_options_, *"region"*, ~string~, ~empty~, GetLocaleRegion(_languageId_)).
+ 1. Let _region_ be ? GetOption(_options_, *"region"*, ~string~, ~empty~, GetLocaleRegion(_baseName_)).
1. If _region_ is not *undefined*, then
1. If _region_ cannot be matched by the unicode_region_subtag
Unicode locale nonterminal, throw a *RangeError* exception.
- 1. Let _variants_ be GetLocaleVariants(_languageId_).
- 1. Let _newLanguageId_ be _language_.
- 1. If _script_ is not *undefined*, set _newLanguageId_ to the string-concatenation of _newLanguageId_, *"-"*, and _script_.
- 1. If _region_ is not *undefined*, set _newLanguageId_ to the string-concatenation of _newLanguageId_, *"-"*, and _region_.
- 1. If _variants_ is not *undefined*, set _newLanguageId_ to the string-concatenation of _newLanguageId_, *"-"*, and _variants_.
- 1. Let _newTag_ be _tag_ with the unicode_language_id
Unicode locale nonterminal replaced by the string _newLanguageId_.
+ 1. Let _variants_ be GetLocaleVariants(_baseName_).
+ 1. Let _allExtensions_ be the suffix of _tag_ following _baseName_.
+ 1. Let _newTag_ be _language_.
+ 1. If _script_ is not *undefined*, set _newTag_ to the string-concatenation of _newTag_, *"-"*, and _script_.
+ 1. If _region_ is not *undefined*, set _newTag_ to the string-concatenation of _newTag_, *"-"*, and _region_.
+ 1. If _variants_ is not *undefined*, set _newTag_ to the string-concatenation of _newTag_, *"-"*, and _variants_.
+ 1. Set _newTag_ to the string-concatenation of _newTag_ and _allExtensions_.
1. Return _newTag_.
unicode_language_id
Unicode locale nonterminal.
+ 1. Return GetLocaleBaseName(_loc_.[[Locale]]).
unicode_locale_id
Unicode locale nonterminal.
+ 1. Return the longest prefix of _locale_ matched by the unicode_language_id
Unicode locale nonterminal.
+ unicode_locale_id
Unicode locale nonterminal.
- 1. Let _languageId_ be the longest prefix of _locale_ matched by the unicode_language_id
Unicode locale nonterminal.
- 1. Assert: The first subtag of _languageId_ can be matched by the unicode_language_subtag
Unicode locale nonterminal.
- 1. Return the first subtag of _languageId_.
+ 1. Let _baseName_ be GetLocaleBaseName(_locale_).
+ 1. Assert: The first subtag of _baseName_ can be matched by the unicode_language_subtag
Unicode locale nonterminal.
+ 1. Return the first subtag of _baseName_.
unicode_locale_id
Unicode locale nonterminal.
- 1. Let _languageId_ be the longest prefix of _locale_ matched by the unicode_language_id
Unicode locale nonterminal.
- 1. Assert: _languageId_ contains at most one subtag that can be matched by the unicode_script_subtag
Unicode locale nonterminal.
- 1. If _languageId_ contains a subtag matched by the unicode_script_subtag
Unicode locale nonterminal, return that subtag.
+ 1. Let _baseName_ be GetLocaleBaseName(_locale_).
+ 1. Assert: _baseName_ contains at most one subtag that can be matched by the unicode_script_subtag
Unicode locale nonterminal.
+ 1. If _baseName_ contains a subtag matched by the unicode_script_subtag
Unicode locale nonterminal, return that subtag.
1. Return *undefined*.
unicode_locale_id
Unicode locale nonterminal.
- 1. Let _languageId_ be the longest prefix of _locale_ matched by the unicode_language_id
Unicode locale nonterminal.
+ 1. Let _baseName_ be GetLocaleBaseName(_locale_).
1. NOTE: A unicode_region_subtag
subtag is only valid immediately after an initial unicode_language_subtag
subtag, optionally with a single unicode_script_subtag
subtag between them. In that position, unicode_region_subtag
cannot be confused with any other valid subtag because all their productions are disjoint.
- 1. Assert: The first subtag of _languageId_ can be matched by the unicode_language_subtag
Unicode locale nonterminal.
- 1. Let _languageIdTail_ be the suffix of _languageId_ following the first subtag.
- 1. Assert: _languageIdTail_ contains at most one subtag that can be matched by the unicode_region_subtag
Unicode locale nonterminal.
- 1. If _languageIdTail_ contains a subtag matched by the unicode_region_subtag
Unicode locale nonterminal, return that subtag.
+ 1. Assert: The first subtag of _baseName_ can be matched by the unicode_language_subtag
Unicode locale nonterminal.
+ 1. Let _baseNameTail_ be the suffix of _baseName_ following the first subtag.
+ 1. Assert: _baseNameTail_ contains at most one subtag that can be matched by the unicode_region_subtag
Unicode locale nonterminal.
+ 1. If _baseNameTail_ contains a subtag matched by the unicode_region_subtag
Unicode locale nonterminal, return that subtag.
1. Return *undefined*.
unicode_locale_id
Unicode locale nonterminal.
- 1. Let _languageId_ be the longest prefix of _locale_ matched by the unicode_language_id
Unicode locale nonterminal.
- 1. If there is a non-empty suffix of _languageId_ that is a consecutive sequence of unicode_variant_subtag
Unicode locale nonterminal, then
+ 1. Let _baseName_ be GetLocaleBaseName(_locale_).
+ 1. If there is a non-empty suffix of _baseName_ that is a consecutive sequence of unicode_variant_subtag
Unicode locale nonterminal, then
1. Let _variants_ be the longest such suffix.
1. Return the substring of _variants_ from 1.
1. Return *undefined*.
diff --git a/spec/locales-currencies-tz.html b/spec/locales-currencies-tz.html
index 99be4b58..faec8dc2 100644
--- a/spec/locales-currencies-tz.html
+++ b/spec/locales-currencies-tz.html
@@ -57,11 +57,11 @@ unicode_locale_id
Unicode locale nonterminal, return *false*.
1. If _lowerLocale_ uses any of the backwards compatibility syntax described in Unicode Technical Standard #35 Part 1 Core, Section 3.3 BCP 47 Conformance, return *false*.
- 1. Let _languageId_ be the longest prefix of _lowerLocale_ matched by the unicode_language_id
Unicode locale nonterminal.
- 1. Let _variants_ be GetLocaleVariants(_languageId_).
+ 1. Let _baseName_ be GetLocaleBaseName(_lowerLocale_).
+ 1. Let _variants_ be GetLocaleVariants(_baseName_).
1. If _variants_ is not *undefined*, then
1. If _variants_ contains any duplicate subtags, return *false*.
- 1. Let _allExtensions_ be the suffix of _lowerLocale_ following _languageId_.
+ 1. Let _allExtensions_ be the suffix of _lowerLocale_ following _baseName_.
1. If _allExtensions_ contains a pu_extensions
Unicode locale nonterminal, let _extensions_ be the prefix of _allExtensions_ preceding the longest such