unicode-org / icu4x

Solving i18n for client-side and resource-constrained environments.
https://icu4x.unicode.org
Other
1.37k stars 176 forks source link

AnyDateTimeFormat should fallback calendars by locale #2038

Closed Manishearth closed 2 years ago

Manishearth commented 2 years ago

Blocked on https://github.com/unicode-org/icu4x/issues/1109

https://github.com/unicode-org/icu4x/pull/1987 adds formatting for AnyCalendar, however it unconditionally falls back to the Gregorian calendar. We should instead be getting this fallbacking from data, ideally using vertical fallback (but we can just have a calendars/default@1 key if we really have to).

Filing a separate issue so it can be a polish blocker.

sffc commented 2 years ago

The regions using non-Gregorian default are:

Source: https://github.com/unicode-org/cldr/blob/b2b36963947b0e3e172fa40519d13afd9877a227/common/supplemental/supplementalData.xml#L4715

Of those, the only one we support right now is Buddhist. So to fix the 1.0 issue, we can hard-code a check for TH. Given that Thai is one of our testdata languages, this would also be a nice test to add to demonstrate the i18n of DateTimeFormatter.

sffc commented 2 years ago

Created #2236 for the longer-term solution to this problem.

Manishearth commented 2 years ago

Related: https://github.com/unicode-org/icu4x/issues/2357