Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose resolved calendar and numbering system #3887

Open
hsivonen opened this issue Aug 18, 2023 · 4 comments
Open

Expose resolved calendar and numbering system #3887

hsivonen opened this issue Aug 18, 2023 · 4 comments
Assignees
Labels
C-data-infra Component: provider, datagen, fallback, adapters C-datetime Component: datetime, calendars, time zones S-small Size: One afternoon (small bug fix or enhancement) U-ecma402 User: ECMA-402 compatibility

Comments

@hsivonen
Copy link
Member

ECMA-402 Intl.DateTimeFormat.prototype.resolvedOptions exposes the resolved calendar and numbering system, but the existing resolve_components method doesn't indicate these.

For ECMA-402 coverage, there should be an accessor for these.

@hsivonen hsivonen added C-datetime Component: datetime, calendars, time zones U-ecma402 User: ECMA-402 compatibility labels Aug 18, 2023
@sffc
Copy link
Member

sffc commented Aug 21, 2023

Calendar is easy. For numbering system, it's an oversight that I think the data doesn't actually name what resolved numbering system you get. For example, here's all we have for arabic:

https://github.com/unicode-org/icu4x/blob/main/provider/datagen/tests/data/json/decimal/symbols%401/ar.json

There's no signal there that this is actually the "arab" numbering system. We should add that to the data file.

@hsivonen
Copy link
Member Author

We should add that to the data file.

Would it be more reliable to inspects what characters digits has and determine the numbering system from the characters?

Or: Why does the data file store the digits instead of storing the numbering system so that digits could be looked up by numbering system? Are there (in practice in CLDR) custom values for digits that don't match any numbering system exactly?

@hsivonen hsivonen changed the title Exposed resolved calendar and numbering system Expose resolved calendar and numbering system Aug 22, 2023
@sffc
Copy link
Member

sffc commented Aug 25, 2023

Would it be more reliable to inspects what characters digits has and determine the numbering system from the characters?

Sure, but we'd need to include that mapping somewhere in runtime data.

Or: Why does the data file store the digits instead of storing the numbering system so that digits could be looked up by numbering system? Are there (in practice in CLDR) custom values for digits that don't match any numbering system exactly?

Mainly because the list of digits is tiny enough that it's more efficient to just copy it into the DecimalSymbols data structure, rather than incur an additional runtime lookup to map the numbering system to the digits.

@sffc sffc self-assigned this Sep 21, 2023
@sffc sffc added this to the 1.x Priority ⟨P2⟩ milestone Sep 21, 2023
@sffc sffc added C-data-infra Component: provider, datagen, fallback, adapters S-small Size: One afternoon (small bug fix or enhancement) labels Sep 21, 2023
@sffc
Copy link
Member

sffc commented Sep 21, 2023

@sffc to write up a design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-data-infra Component: provider, datagen, fallback, adapters C-datetime Component: datetime, calendars, time zones S-small Size: One afternoon (small bug fix or enhancement) U-ecma402 User: ECMA-402 compatibility
Projects
None yet
Development

No branches or pull requests

2 participants