This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Canonicalization between ApplyOptionsToTag and ApplyUnicodeExtensionToTag with grandfathered tags #17
Comments
The strange thing is that passing the var options = {region: "US", calendar: "gregory"}
var loc = new Intl.Locale("en-gb-oed", options);
var loc2 = new Intl.Locale(loc, options);
assert.sameValue(loc.toString(), loc2.toString())
// Expected SameValue(«en-GB-oxendict-u-ca-gregory», «en-US-oxendict-u-ca-gregory») to be true Should we perhaps canonicalize the grandfathered tags first? |
Oops, good catch.
This sounds like a good idea. Should we do this by adding an additional CanonicalizeLanguageTag call to the top of ApplyOptionsToTag? If we add this additional call, does it remove the need for the existing call, or do we need both? |
littledan
added a commit
that referenced
this issue
Jul 15, 2018
- Options which can't be applied to private use or grandfathered tags, whether script, region or Unicode extensions, trigger a RangeError in the constructor. (Closes #25 and #12) - Insert additional calls to CanonicalizeLanguageTag for grandfathered tags, to enable options to be applied. (Closes #17) - For grandfathered or private use tags, the entire tag is treated as the "language", both for the purposes of the Intl.Locale.prototype.language getter and for the language property of the options bag in the constructor. (Follows #25 (comment))
littledan
added a commit
that referenced
this issue
Jul 28, 2018
- Options which can't be applied to private use or grandfathered tags, whether script, region or Unicode extensions, trigger a RangeError in the constructor. (Closes #25 and #12) - Insert additional calls to CanonicalizeLanguageTag for grandfathered tags, to enable options to be applied. (Closes #17) - For grandfathered or private use tags, the entire tag is treated as the "language", both for the purposes of the Intl.Locale.prototype.language getter and for the language property of the options bag in the constructor. (Follows #25 (comment))
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Consider this example:
If a grandfathered tag has a modern replacement, calling CanonicalizeLanguageTag will change the grandfathered tag into a normal
langtag
language tag. And that means options applied in ApplyOptionsToTag are ignored, but options applied in ApplyUnicodeExtensionToTag are used. Do we want to support this behaviour or do we rather want to ignore all options if the original input was a grandfathered language tag?The text was updated successfully, but these errors were encountered: