-
Notifications
You must be signed in to change notification settings - Fork 114
Description
https://tc39.github.io/ecma402/#sec-canonicalizelanguagetag
It takes the steps specified in RFC 5646 section 4.5, or successor, to bring the language tag into canonical form, and to regularize the case of the subtags, but does not take the steps to bring a language tag into "extlang form" and to reorder variant subtags.
The last bit is a bit unclear as to whether reordering variant subtags is required by the spec.
I think this should be rewritten as one of the following options to make it clear whether this is required or not.
It takes the steps specified in RFC 5646 section 4.5, or successor, to bring the language tag into canonical form,
andto regularize the case of the subtags, and to reorder variant subtags, but does not take the steps to bring a language tag into "extlang form."
It takes the steps specified in RFC 5646 section 4.5, or successor, to bring the language tag into canonical form, and to regularize the case of the subtags, but does not take the steps to bring a language tag into "extlang form" nor to reorder variant subtags.
FWIW, it seems that implementations based on the ICU as well as ChakraCore (using Windows Globalization) do reorder variant subtags. (EDIT: I got my terminology mixed up, this point and the following example are not especially important anyway as the issue is about a possible lack of clarity in the language.)
Intl.getCanonicalLocales('de-de-u-kn-true-co-phonebk');
// equals 'de-DE-u-co-phonebk-kn-true'@bterlson FYI