mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +00:00
LibUnicode: Generate Unicode locale alias data
CLDR contains a set of aliases for languages, territories, etc. that no longer are meant to be used (e.g. due to deprecation). For example, the language "aam" is deprecated and should be canonicalized as "aas".
This commit is contained in:
parent
d13142f015
commit
9b118f1f06
3 changed files with 132 additions and 2 deletions
|
@ -640,4 +640,49 @@ Optional<StringView> get_locale_currency_mapping([[maybe_unused]] StringView loc
|
|||
#endif
|
||||
}
|
||||
|
||||
Optional<StringView> resolve_language_alias(StringView language)
|
||||
{
|
||||
#if ENABLE_UNICODE_DATA
|
||||
return Detail::resolve_language_alias(language);
|
||||
#else
|
||||
return language;
|
||||
#endif
|
||||
}
|
||||
|
||||
Optional<StringView> resolve_territory_alias(StringView territory)
|
||||
{
|
||||
#if ENABLE_UNICODE_DATA
|
||||
return Detail::resolve_territory_alias(territory);
|
||||
#else
|
||||
return territory;
|
||||
#endif
|
||||
}
|
||||
|
||||
Optional<StringView> resolve_script_tag_alias(StringView script_tag)
|
||||
{
|
||||
#if ENABLE_UNICODE_DATA
|
||||
return Detail::resolve_script_tag_alias(script_tag);
|
||||
#else
|
||||
return script_tag;
|
||||
#endif
|
||||
}
|
||||
|
||||
Optional<StringView> resolve_variant_alias(StringView variant)
|
||||
{
|
||||
#if ENABLE_UNICODE_DATA
|
||||
return Detail::resolve_variant_alias(variant);
|
||||
#else
|
||||
return variant;
|
||||
#endif
|
||||
}
|
||||
|
||||
Optional<StringView> resolve_subdivision_alias(StringView subdivision)
|
||||
{
|
||||
#if ENABLE_UNICODE_DATA
|
||||
return Detail::resolve_subdivision_alias(subdivision);
|
||||
#else
|
||||
return subdivision;
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue