Description
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:
Let list be a List of 1 or more unique canonical calendar identifiers, which must be lower case String values conforming to the type sequence from UTS 35 Unicode Locale Identifier, section 3.2, sorted in descending preference of those in common use for date and time formatting in locale.
To something like:
Let list be a List of 1 or more unique canonical calendar identifiers, which must be lower case String values conforming to the type sequence from UTS 35 Unicode Locale Identifier, section 3.2, sorted in descending preference of those in common use for date and time formatting in locale. When no calendar information for locale is available, use the calendar identifiers in common use for the locale "und-001".
For example returning ["gregory"]
for new Intl.Locale("tlh").calendars
doesn't match the actual calendar used in tlh
, but instead reflects that the fallback locale und-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.