Implement Intl.LocaleInfo
Categories
(Core :: JavaScript: Internationalization API, enhancement, P3)
Tracking
()
People
(Reporter: yulia, Assigned: anba)
References
(Blocks 3 open bugs, )
Details
(Keywords: dev-doc-needed, leave-open, Whiteboard: [DocArea=JS])
Attachments
(17 files, 1 obsolete file)
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•3 years ago
|
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Assignee | ||
Comment 2•3 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•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 4•3 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•3 years ago
|
||
Similar to part 2, but this time for collations instead of calendars.
Depends on D116467
Assignee | ||
Comment 6•3 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•3 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•3 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•3 years ago
|
||
Depends on D116471
Assignee | ||
Comment 10•3 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•3 years ago
|
||
Patches split for review, but I'm still waiting for the open spec issues to be resolved before actually requesting review.
Updated•2 years ago
|
Assignee | ||
Comment 12•2 years ago
|
||
Pass through the "commonlyUsed" parameter to ICU to be able to filter any
uncommon keyword values.
Assignee | ||
Comment 13•2 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•2 years ago
|
||
Depends on D125571
Assignee | ||
Comment 15•2 years ago
|
||
Use the new NumberingSystem
class to replace UNumberingSystem
in SpiderMonkey.
Depends on D125572
Assignee | ||
Comment 16•2 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•2 years ago
|
||
TimeZone
objects 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
TimeZone
objects.
Therefore let's rename GetDefaultTimeZoneOffsetMs()
to GetRawOffsetMs()
.
Depends on D125574
Assignee | ||
Comment 18•2 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•2 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•2 years ago
|
||
The last addition for the "Intl Locale Info API" proposal.
Depends on D125577
Assignee | ||
Comment 21•2 years ago
|
||
Move CreateArrayFromList
to intl/CommonFunctions so later patches in this
patch stack can use it.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Comment 22•2 years ago
|
||
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/5518e046d03a Part 1: Add "commonlyUsed" to Calendar and Collator. r=platform-i18n-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/4fb2491acf41 Part 2: Add DateTimeFormat::GetAllowedHourCycles(). r=platform-i18n-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/91c7f73689b3 Part 3: Add NumberingSystem class to the unified Intl API component. r=platform-i18n-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/a56309fdebdd Part 4: Switch intl_numberingSystem to use mozilla::intl::NumberingSystem. r=platform-i18n-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/2478cae35f36 Part 5: Move time zone functions from mozilla::Calendar into mozilla::TimeZone. r=platform-i18n-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/afb87d21b97b Part 6: Rename GetDefaultTimeZoneOffsetMs() to GetRawOffsetMs(). r=platform-i18n-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/3e6b7914038c Part 7: Add method to enumerate over all time zones used in a region. r=platform-i18n-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/5c5ea857c3d9 Part 8: Add a method to retrieve week day information to Calendar. r=platform-i18n-reviewers,gregtatum
Comment 23•2 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•1 year 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•1 year ago
|
||
The spec for the proposal didn't progress in the last months.
Comment 26•1 year 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•1 year 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.
Description
•