1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

LibUnicode: Generate numeric keyword values for each locale

This is needed for Intl.NumberFormat's usage of the ResolveLocale AO,
where the [[RelevantExtensionKeys]] internal slot will be "nu".
This commit is contained in:
Timothy Flynn 2021-09-10 09:56:11 -04:00 committed by Linus Groh
parent f5de4f24b2
commit b1d4bcf364
3 changed files with 58 additions and 0 deletions

View file

@ -790,6 +790,15 @@ Optional<StringView> get_locale_currency_mapping([[maybe_unused]] StringView loc
#endif
}
Vector<StringView> get_locale_key_mapping([[maybe_unused]] StringView locale, [[maybe_unused]] StringView keyword)
{
#if ENABLE_UNICODE_DATA
if (auto values = Detail::get_locale_key_mapping(locale, keyword); values.has_value())
return values->split_view(',');
#endif
return {};
}
Optional<ListPatterns> get_locale_list_patterns([[maybe_unused]] StringView locale, [[maybe_unused]] StringView type, [[maybe_unused]] StringView style)
{
#if ENABLE_UNICODE_DATA