-
Notifications
You must be signed in to change notification settings - Fork 12
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
Define fallback behaviour in {Calendars,Collations,HourCycles,NumberingSystems,CharacterDirection,WeekInfo}OfLocale #76
Comments
Or maybe even just define explicit fallback values instead of defaulting to
(When This seems a bit problematic to me. |
I do not think we need to define the fallback behavior. The fallback is just part of the detail of how to decode locale data. Conceputally every locale has a value, the fact that the resource data in ICU does not explicit define them are just a memory optimization strategy to not duplicate the information when that information are the same as the fallback value. The fallback are just an implementation detail that CLDR define based on that data model. Conceptually each locale has every values, either explicitly encoded in the resources or implictly getting from the fallback. |
@sffc @zbraniecki @ben-allen @gibson042 - any opinion? |
TimeZone is exceptional because it impacts the rendered value of the data. The others are all preference-related, so it makes sense to use a CLDR fallback algorithm (which may do something such as looking up a value from likely subtags).
This situation, "when no calendar information for locale is available", is still fuzzy. The calendar is defined in CLDR by region, but it may be reasonable for |
1 similar comment
TimeZone is exceptional because it impacts the rendered value of the data. The others are all preference-related, so it makes sense to use a CLDR fallback algorithm (which may do something such as looking up a value from likely subtags).
This situation, "when no calendar information for locale is available", is still fuzzy. The calendar is defined in CLDR by region, but it may be reasonable for |
The input may not be a recognised locale, for example consider So for bogus inputs or if no corresponding locale data is available, spec steps like:
can't be applied, because neither the preference nor the common use can be determined. Maybe there was a misunderstanding when I mentioned "fallback"? I didn't mean "fallback" to refer to some locale inheritance scheme, but instead what values should be used as the fallback when no data is available at all. |
This issue is similar to #47.
TimeZonesOfLocale is currently defined to return an empty Array object when no time zones are in use for a specific region. This matches the behaviour of ICU4C. (See also #47)
The other abstract operations (
{Calendars,Collations,HourCycles,NumberingSystems,CharacterDirection,WeekInfo}OfLocale
) don't define their fallback behaviour. To match the ICU4C behaviour, the description should be updated to say that the locale"und-001"
is used as the fallback when the input locale is unsupported. (At least I think that's the default fallback behaviour in ICU4C.)For example in CalendarsOfLocale, change step 4 from:
To something like:
For example returning
["gregory"]
fornew Intl.Locale("tlh").calendars
doesn't match the actual calendar used intlh
, but instead reflects that the fallback localeund-001
is used.There isn't a way for a user to detect when the fallback locale is used instead of the input locale, but that's a pre-existing issue in this proposal.
The text was updated successfully, but these errors were encountered: