Skip to content

Obtaining all available locales for a DataKey #2374

Answered by sffc
jedel1043 asked this question in Q&A
Discussion options

You must be logged in to vote

See also #58 and #1092

Please note that ECMA-402 never actually exposes the set of available locales, only the supportedLocalesOf function. The ICU4X data provider follows the same model; it can answer whether or not a locale is supported, but it doesn't give you the full list. It doesn't do this because there's no such thing as a list of supported locales; the set is unbounded due to locale fallback.

Therefore, please perform data requests for each locale in the list, and use that to determine whether or not to include the locale in the output list. You can either perform direct lookup (no fallback), in which case you can check for DataErrorKind::MissingLocale, or lookup with fallback, i…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jedel1043
Comment options

jedel1043 Aug 14, 2022
Collaborator Author

@jedel1043
Comment options

jedel1043 Aug 19, 2022
Collaborator Author

@sffc
Comment options

sffc Aug 19, 2022
Maintainer

@sffc
Comment options

sffc Aug 19, 2022
Maintainer

Answer selected by jedel1043
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants