mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +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:
parent
f5de4f24b2
commit
b1d4bcf364
3 changed files with 58 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -137,6 +137,7 @@ Optional<StringView> get_locale_language_mapping(StringView locale, StringView l
|
|||
Optional<StringView> get_locale_territory_mapping(StringView locale, StringView territory);
|
||||
Optional<StringView> get_locale_script_mapping(StringView locale, StringView script);
|
||||
Optional<StringView> get_locale_currency_mapping(StringView locale, StringView currency);
|
||||
Vector<StringView> get_locale_key_mapping(StringView locale, StringView keyword);
|
||||
Optional<ListPatterns> get_locale_list_patterns(StringView locale, StringView type, StringView style);
|
||||
|
||||
Optional<StringView> resolve_language_alias(StringView language);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue