Ship Intl.DisplayNames
Categories
(Core :: JavaScript: Internationalization API, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: Waldo, Assigned: anba)
Details
(Keywords: dev-doc-complete)
Attachments
(3 files)
Intl.DisplayNames
is implemented, but some spec issues remain in the way of shipping just yet, per anba in bug 1557727 comment 22.
For example, the spec doesn't adequately consider whether inputs should be canonicalized -- if you try to get an aliased region tag formatted, should the returned string be for its replacement? SpiderMonkey always canonicalizes, which is arguably not consistent with the current spec:
js> new Intl.DisplayNames("en", {type:"region", style:"narrow"}).of("GB")
"UK"
js> new Intl.DisplayNames("en", {type:"region", style:"narrow"}).of("UK")
"UK"
ICU also just doesn't even contain data for some deprecated regions -- "SU" is always considered as Russia, not Soviet Union. A similar canonicalization concern exists for scripts. And at present there's not complete consensus on what to do in these cases.
Still, support may be good enough to at least turn it on in nightly builds.
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Instead of returning the fully canonicalised script resp. region subtag,
only return the case-canonicalised subtag when no localised name was found.
Note: Language tags are still fully canoncalised.
Spec issues:
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Depends on D93230
Assignee | ||
Comment 3•3 years ago
|
||
Update test files which expected resolvedOptions()
to return the default
calendar: (Only MozIntl.DisplayNames
still supports calendar
.)
- DisplayNames/currency.js
- DisplayNames/language.js
- DisplayNames/region.js
- DisplayNames/script.js
Update tests using extensions for MozIntl.DisplayNames
to explicitly
install MozIntl.DisplayNames
:
- DisplayNames/calendar.js
- DisplayNames/dateTimeField.js
- DisplayNames/dayPeriod.js
- DisplayNames/month.js
- DisplayNames/quarter.js
- DisplayNames/weekday.js
And finally update test262 tests to no longer use addIntlExtras()
to
install Intl.DisplayNames
.
Depends on D93231
Updated•3 years ago
|
Updated•3 years ago
|
Pushed by csabou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/433766579bf1 Part 1: Only case-canonicalise script and region subtags. r=jwalden https://hg.mozilla.org/integration/autoland/rev/c73bdf2d4ca1 Part 2: Enable Intl.DisplayNames by default. r=jwalden https://hg.mozilla.org/integration/autoland/rev/318623c3418c Part 3: Update Intl.DisplayNames tests. r=yulia
Comment 5•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/433766579bf1
https://hg.mozilla.org/mozilla-central/rev/c73bdf2d4ca1
https://hg.mozilla.org/mozilla-central/rev/318623c3418c
Comment 6•2 years ago
|
||
Rumyra documented this; it was already documented, so she added a rel note to the Fx86 rel notes, and updated the compat data. See https://github.com/mdn/content/issues/1721 for more details on the work.
Let us know if you spot anything else that needs attention.
Description
•