Comments (13)
Is there an option for us to not support grandfathered tags at all?
from proposal-intl-locale.
Do we want to restrict the input for Intl.Locale if certain Unicode extensions values aren't supported in Intl.{Collator, NumberFormat, DateTimeFormat}?
I don't think we want that. Intl.Locale
is supposed to handle any bcp47 language tag string, not just the one we support in other formatters.
from proposal-intl-locale.
#13 should fix all mentioned issues except for:
Step 3 should read:
If tag matches the langtag production and does not match grandfathered,
to cover the case of regular grandfathered language tags.
from proposal-intl-locale.
@anba My intention was to simply not support grandfathered language tags.
from proposal-intl-locale.
Only irregular or also regular grandfathered language tags?
from proposal-intl-locale.
Oh sorry, I meant irregular grandfathered tags. So, the change you are suggesting seems important.
from proposal-intl-locale.
Oh sorry, I meant irregular grandfathered tags. So, the change you are suggesting seems important.
Hmm, I'm a bit confused right now. The suggested change is only important if we also disallow regular grandfathered language tags.
from proposal-intl-locale.
On second the possible restriction should probably use If tag matches neither the privateuse nor the grandfathered production,
followed by Assert: tag matches the langtag production.
instead of If tag matches the langtag production and does not match grandfathered,
, because the former more clearly states the two unsupported productions.
from proposal-intl-locale.
I've tried to represent these questions on the agenda of the Intl call next Friday so we can get more input.
from proposal-intl-locale.
There are at least two more issue with grandfathered tags:
1. If the input is a regular grandfathered tag without a modern replacement, appending Unicode extension sequences will create a non-valid language tag ("valid" in the sense of https://tools.ietf.org/html/rfc5646#section-2.2.9):
var loc = new Intl.Locale("cel-gaulish", {nu: "latn"});
print(loc.toString()); "cel-gaulish-u-nu-latn"
Since cel-gaulish-u-nu-latn
no longer matches a grandfathered production, it has to be interpreted as a langtag
language tag, which in turn means gaulish
has to interpreted as a variant subtag. But gaulish
is not a registered variant subtag, so the generated tag cel-gaulish-u-nu-latn
is non-valid per RFC 5646.
While Intl.Locale
in general doesn't care about non-valid language tags, we may still want to prevent generating non-valid language tags if the input itself was a valid language tag.
2. ICU uses its own replacement for grandfathered tags without modern replacements (and en-GB-oed).
- cel-gaulish → xtg-x-cel-gaulish
- zh-min → nan-x-zh-min
- en-GB-oed → en-GB-x-oed (Modern replacement available: en-GB-oxendict)
- i-default → en-x-i-default
- i-enochian → x-i-enochian
- i-mingo → see-x-i-mingo
As with the other grandfathered tags issues this shouldn't matter much in practice, because I don't expect that grandfathered tags are actually used in normal code.
from proposal-intl-locale.
en-GB-oed → en-GB-x-oed (Modern replacement available: en-GB-oxendict)
Good catch. filed IcuBug:13650
from proposal-intl-locale.
We discussed grandfathered tags at the last Intl meeting. The resolution, I believe, was to support regular and irregular grandfathered tags by mapping them each to modern tags, at the beginning of the process of parsing them. I believe this change was recommended for all of Intl, and not just Locale.
from proposal-intl-locale.
We've switched to Unicode BCP 47 Locale Identifiers, fixing the remaining issues.
from proposal-intl-locale.
Related Issues (20)
- Modified CanonicalizeLocaleList does not accept Intl.Locale instances when provided as the only argument HOT 1
- Using Unicode locale ID vs BCP 47 in our spec HOT 51
- Resolved value for Unicode extension values when "true" is removed? HOT 4
- Simplified the change to 2.1 CanonicalizeLocaleList HOT 3
- Docs(MDN) Documentation for Intl.Locale HOT 17
- Does hourCycle exist unconditionally? HOT 3
- Not all RFC 5646 production names updated HOT 3
- Move "get caseFirst" after "get calendar"
- Update references to match current UTS 35 spec HOT 11
- Use `type` production from UTS35
- Directly use unicode_language_id in "get baseName"
- Need to test for SameValue(r.[[kn]], "") in addition to SameValue(r.[[kn]], "true")
- no validation of value of extensions in tag? HOT 8
- CanonicalizeLanguageTag should remove duplicate attributes/keywords in a Unicode extension, consistent with Intl.Locale HOT 6
- Getting the default locale HOT 10
- Drop this proposal in favor of a more general user settings object HOT 6
- Spec is vague regarding internal data structure representation HOT 12
- Canonicalise Unicode extensions options added through ResolveLocale HOT 8
- CanonicalizeUnicodeLocaleId should only perform step 1 of "BCP 47 Language Tag to Unicode BCP 47 Locale Identifier" HOT 3
- Archive repository, redirect draft to ecma402 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proposal-intl-locale.