Implement Intl.LocaleInfo
Categories
(Core :: JavaScript: Internationalization API, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox152 | --- | fixed |
People
(Reporter: yulia, Assigned: anba)
References
(Blocks 2 open bugs)
Details
(5 keywords, Whiteboard: [DocArea=JS][platform-feature])
User Story
platform-scheduled:2025-06-30 web-feature:intl-locale-info user-impact-score:80 webcompat-risk:moderate
Attachments
(23 files, 10 obsolete files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
Currently at stage 2
| Assignee | ||
Updated•5 years ago
|
| Reporter | ||
Updated•5 years ago
|
| Assignee | ||
Comment 1•5 years ago
|
||
| Assignee | ||
Comment 2•5 years ago
|
||
Only a draft patch for now until the various issues I've reported at https://github.com/tc39/proposal-intl-locale-info/issues have been resolved resp. clarified.
| Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
| Assignee | ||
Comment 4•5 years ago
|
||
LocaleObject doesn't use a reserved slot to store the [[Calendar]] internal
slot, so we have to extract any Unicode "ca" extension sequences directly
from the locale identifier via GetUnicodeExtension().
If no "ca" Unicode keyword is present in the locale, we're calling into ICU
to retrieve all commonly used calendars of the locale (via
ucal_getKeywordValuesForLocale()).
ICU has certain internal limits on how large the input locale can be, so to make
sure we don't run into these limits, the LocaleLSR helper class extracts the
language, script, and region subtags of a locale. The LSR-subtags are guaranteed
to fit into the ICU limits.
Depends on D115223
| Assignee | ||
Comment 5•5 years ago
|
||
Similar to part 2, but this time for collations instead of calendars.
Depends on D116467
| Assignee | ||
Comment 6•5 years ago
|
||
Unfortunately support for hour cycles is more convoluted, because ICU doesn't
have public APIs to get the complete set of supported hour cycles for a locale:
There is udatpg_getDefaultHourCycle(), but that function only returns the
default hour cycle, but not any additionally allowed hour cycles. So we have to
do it the hard way and directly read ICU resource bundles to get the data we
need for this feature.
Depends on D116468
| Assignee | ||
Comment 7•5 years ago
|
||
There is no way to figure out which numbering systems are commonly used by a
specific locale (because this data isn't even recorded in CLDR), so we can
only return the default numbering system.
Depends on D116469
| Assignee | ||
Comment 8•5 years ago
|
||
Time zone names are canonicalised and sorted alphabetically. Canonicalisation
has the usual problem that ICU uses CLDR time zone canonicalisation, whereas
the spec requires IANA canonicalisation, so we have to perform some extra
steps here.
Depends on D116470
| Assignee | ||
Comment 9•5 years ago
|
||
Depends on D116471
| Assignee | ||
Comment 10•5 years ago
|
||
This code is based on the existing code in js::intl_GetCalendarInfo() with
the exception of gracefully handling UCAL_WEEKEND_{ONSET,CEASE} instead of
throwing an error.
Depends on D116472
| Assignee | ||
Comment 11•5 years ago
|
||
Patches split for review, but I'm still waiting for the open spec issues to be resolved before actually requesting review.
Updated•5 years ago
|
| Assignee | ||
Comment 12•5 years ago
|
||
Pass through the "commonlyUsed" parameter to ICU to be able to filter any
uncommon keyword values.
| Assignee | ||
Comment 13•5 years ago
|
||
ICU's public API only provides a function to return the preferred hour cycle
(udatpg_getDefaultHourCycle()), whereas for Intl.Locale we want to be able
to determine all allowed hour cycles. So we have to do it the hard way and
directly read ICU resource bundles to get the data we need for this feature.
Depends on D125570
| Assignee | ||
Comment 14•5 years ago
|
||
Depends on D125571
| Assignee | ||
Comment 15•5 years ago
|
||
Use the new NumberingSystem class to replace UNumberingSystem in SpiderMonkey.
Depends on D125572
| Assignee | ||
Comment 16•5 years ago
|
||
Time zone functions being part of UCalendar is an internal implementation
detail of ICU4C. For the public unified Intl API we should rather follow
Temporal (or ICU4C's C++ API) and have a separate TimeZone class.
The files were moved using hg cp to preserve the file history.
Depends on D125573
| Assignee | ||
Comment 17•5 years ago
|
||
TimeZoneobjects can be created with any time zone identifier, so the "Default"
part in the name isn't correct.- The "TimeZone" part is no longer needed, now that there's a distinct class for
TimeZoneobjects.
Therefore let's rename GetDefaultTimeZoneOffsetMs() to GetRawOffsetMs().
Depends on D125574
| Assignee | ||
Comment 18•5 years ago
|
||
The filter type is UCAL_ZONE_TYPE_ANY to ensure all possible time zones are
returned, and not just CLDR canonical time zones. (CLDR canonical time zones
are different from IANA canonical time zones.)
Depends on D125575
| Assignee | ||
Comment 19•5 years ago
|
||
Currently only provides a single method to retrieve the character orientation.
The default constructor was deleted because all methods are static.
Depends on D125576
| Assignee | ||
Comment 20•5 years ago
|
||
The last addition for the "Intl Locale Info API" proposal.
Depends on D125577
| Assignee | ||
Comment 21•5 years ago
|
||
Move CreateArrayFromList to intl/CommonFunctions so later patches in this
patch stack can use it.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
Comment 22•5 years ago
|
||
Comment 23•5 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/5518e046d03a
https://hg.mozilla.org/mozilla-central/rev/4fb2491acf41
https://hg.mozilla.org/mozilla-central/rev/91c7f73689b3
https://hg.mozilla.org/mozilla-central/rev/a56309fdebdd
https://hg.mozilla.org/mozilla-central/rev/2478cae35f36
https://hg.mozilla.org/mozilla-central/rev/afb87d21b97b
https://hg.mozilla.org/mozilla-central/rev/3e6b7914038c
https://hg.mozilla.org/mozilla-central/rev/5c5ea857c3d9
Comment 24•4 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:sdetar, maybe it's time to close this bug?
For more information, please visit auto_nag documentation.
| Assignee | ||
Comment 25•4 years ago
|
||
The spec for the proposal didn't progress in the last months.
Comment 26•3 years ago
|
||
Hi Anba, Frank is hoping to advance this to stage 4 in the near term, and he is wondering if you are waiting on any information from him prior to you being able to continue with the implementation. Thanks!
| Assignee | ||
Comment 27•3 years ago
|
||
Issues like https://github.com/tc39/proposal-intl-locale-info/issues/30 still need to be resolved. The last comment seems to be confused about the meaning of [[RelevantExtensionKeys]] for Intl.Locale: While it is true that Intl.Locale has a [[RelevantExtensionKeys]] internal slot, Intl.Locale isn't an Intl service constructor, so Intl.Locale.[[RelevantExtensionKeys]] doesn't imply that Intl.Locale instances have to care about any extension keys.
Updated•2 years ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 31•1 year ago
|
||
Issues like https://github.com/tc39/proposal-intl-locale-info/issues/30 still need to be resolved.
It looks like this issue was resolved on 2024-11-24. Are there any other blockers?
Comment 32•1 year ago
|
||
This implements the accessor property textInfo, but keep in mind it's now a method called getTextInfo to prevent the situation of locale.textInfo === locale.textInfo returning false: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 33•1 year ago
|
||
I think we're waiting on https://github.com/tc39/proposal-intl-locale-info/issues/76 before we can finish this off.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•8 months ago
|
Comment 34•7 months ago
|
||
(In reply to Dan Minor [:dminor] from comment #33)
I think we're waiting on https://github.com/tc39/proposal-intl-locale-info/issues/76 before we can finish this off.
This seems resolved, are there still any blockers?
Comment 35•7 months ago
|
||
Hi Anba, are you planning on finishing this off, or would you like me to have a look? It's no problem either way, just would like to know for planning purposes. Thanks :)
| Assignee | ||
Comment 36•7 months ago
|
||
I was planing to look into this again next month. There are still some other Intl and Temporal related things I'd like to tackle first.
Comment 37•7 months ago
|
||
Great, thank you for working on this :)
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
| Assignee | ||
Comment 38•5 months ago
|
||
| Assignee | ||
Comment 39•5 months ago
|
||
| Assignee | ||
Comment 40•5 months ago
|
||
| Assignee | ||
Comment 41•5 months ago
|
||
New Intl.Locale methods will return arrays and objects, so we now need to
handle these types here.
| Assignee | ||
Comment 42•5 months ago
|
||
For now we only need to access LocaleDirectionality from the icu_locale crate.
| Assignee | ||
Comment 43•5 months ago
|
||
| Assignee | ||
Comment 44•5 months ago
|
||
ICU4C doesn't have information for additional numbering systems per locale, so
getNumberingSystems will always return an array with a single element.
| Assignee | ||
Comment 45•5 months ago
|
||
| Assignee | ||
Comment 46•5 months ago
|
||
Used in part 10.
| Assignee | ||
Comment 47•5 months ago
|
||
Used in part 12-14.
| Assignee | ||
Comment 48•5 months ago
|
||
Used in part 12.
| Assignee | ||
Comment 49•5 months ago
|
||
| Assignee | ||
Comment 50•5 months ago
|
||
| Assignee | ||
Comment 51•5 months ago
|
||
| Assignee | ||
Comment 52•5 months ago
|
||
Updated•5 months ago
|
Comment 53•5 months ago
|
||
Comment 54•5 months ago
|
||
Comment 55•5 months ago
|
||
| Assignee | ||
Updated•5 months ago
|
Comment 56•5 months ago
|
||
| Assignee | ||
Updated•5 months ago
|
Comment 57•5 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/84a6690e5d25
https://hg.mozilla.org/mozilla-central/rev/313d4c4c5a70
https://hg.mozilla.org/mozilla-central/rev/3c20b54a8332
https://hg.mozilla.org/mozilla-central/rev/bf47a8739a14
https://hg.mozilla.org/mozilla-central/rev/c33d244e638f
https://hg.mozilla.org/mozilla-central/rev/dd423fda0778
https://hg.mozilla.org/mozilla-central/rev/edfebd30076a
https://hg.mozilla.org/mozilla-central/rev/b881fccf10d5
https://hg.mozilla.org/mozilla-central/rev/b65263c12398
https://hg.mozilla.org/mozilla-central/rev/0351d8300630
https://hg.mozilla.org/mozilla-central/rev/39ddc2b7a87e
https://hg.mozilla.org/mozilla-central/rev/2e7046c6a91a
https://hg.mozilla.org/mozilla-central/rev/52c4257c2c82
https://hg.mozilla.org/mozilla-central/rev/d6b9d2985593
https://hg.mozilla.org/mozilla-central/rev/cffe3dbfd93a
Comment 58•4 months ago
|
||
Is this something we should call out in the Fx152 relnotes? Please add a relnote-firefox? nomination if yes.
| Assignee | ||
Comment 59•4 months ago
|
||
The feature is still behind a flag + Nightly-only. The current plan is to ship it in Firefox 153 (bug 2037069), so I guess relnote-firefox? should be added to that bug?
Comment 60•4 months ago
|
||
Yeah, we can wait. Sorry, I missed that it was still disabled by default. FYI, we can add a Nightly-only release note too if/when it's enabled there before it's ready to ride the trains.
Updated•4 months ago
|
Updated•4 months ago
|
Comment 61•4 months ago
|
||
FF152 MDN docs work for this can be tracked in https://github.com/mdn/content/issues/44172 (update to experimental features and a compatibility data update).
Comment 62•2 months ago
|
||
Bug was resolved, but the web-feature intl-locale-info (definition file) is not yet marked as supported in Firefox.
Feature bugs are usually automatically closed once the corresponding web-features are marked as supported; this typically happens after the feature reaches release.
Updated•2 months ago
|
Updated•18 days ago
|
Description
•