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

Add option to use variant era names #845

Open
1ec5 opened this issue Dec 12, 2023 · 1 comment
Open

Add option to use variant era names #845

1ec5 opened this issue Dec 12, 2023 · 1 comment
Labels
c: datetime Component: dates, times, timezones Proposal Larger change requiring a proposal s: blocked Status: the issue is blocked on upstream

Comments

@1ec5
Copy link

1ec5 commented Dec 12, 2023

The Intl.DateTimeFormat() constructor’s era option causes the formatted date to include the default form of an era name. CLDR allows locales to specify a “variant” form. For example, in English, the default forms are “BC” and “AD”, while the variant forms are “BCE” and “CE”. In some other languages, secular equivalents to “BCE” and “CE” are the default, while the variants are for some other synonym. The use of the non-secular forms can be awkward in some academic contexts or even offensive in some religious contexts.

As far as I can tell, the Internationalization API does not provide access to these variant forms, but it would be useful as an option for some applications. For example, the OpenHistoricalMap project has been maintaining translations of “BCE” and “CE”. In order to localize date formats using Intl.DateTimeFormat, it’ll need to use formatToParts() to splice out and replace the default era names with the translated variant era names: OpenHistoricalMap/issues#626 (comment).

Based on CLDR’s LDML syntax, perhaps it would be reasonable to add an option alongside era like eraForm that can be set to either default or variant.

@sffc sffc added s: discuss Status: TG2 must discuss to move forward c: datetime Component: dates, times, timezones Proposal Larger change requiring a proposal labels Dec 14, 2023
@sffc sffc added this to Other Issues in ECMA-402 Meeting Topics Dec 14, 2023
@sffc sffc moved this from Other Issues to Previously Discussed in ECMA-402 Meeting Topics Dec 14, 2023
@sffc
Copy link
Contributor

sffc commented Dec 15, 2023

TG2 discussion: https://github.com/tc39/ecma402/blob/master/meetings/notes-2023-12-14.md#add-option-to-use-variant-era-names-845

We will revisit when Temporal, Era Code, and Era Display are all landed.

@sffc sffc added s: blocked Status: the issue is blocked on upstream and removed s: discuss Status: TG2 must discuss to move forward labels Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: datetime Component: dates, times, timezones Proposal Larger change requiring a proposal s: blocked Status: the issue is blocked on upstream
Projects
ECMA-402 Meeting Topics
Previously Discussed
Development

No branches or pull requests

2 participants