Closed Bug 1654116 Opened 3 years ago Closed 3 years ago

Ship Intl.DisplayNames


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




86 Branch
Tracking Status
firefox86 --- fixed


(Reporter: Waldo, Assigned: anba)


(Keywords: dev-doc-complete)


(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")
js> new Intl.DisplayNames("en", {type:"region", style:"narrow"}).of("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

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
Part 1: Only case-canonicalise script and region subtags. r=jwalden
Part 2: Enable Intl.DisplayNames by default. r=jwalden
Part 3: Update Intl.DisplayNames tests. r=yulia
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 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.