Closed Bug 1654116 Opened 4 years ago Closed 3 years ago

Ship Intl.DisplayNames

Categories

(Core :: JavaScript: Internationalization API, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
86 Branch
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.

Severity: -- → N/A

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:

Assignee: nobody → andrebargull
Status: NEW → ASSIGNED

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

Priority: -- → P1
Attachment #9181047 - Attachment description: Bug 1654116 - Part 3: Update Intl.DisplayNames tests. r=jwalden! → Bug 1654116 - Part 3: Update Intl.DisplayNames tests. r=yulia!
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
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch

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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: