mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibUnicode: Resolve the most likely territory alias when there are many
This commit is contained in:
parent
1fbc5dba08
commit
fd0011989a
Notes:
sideshowbarker
2024-07-18 04:57:04 +09:00
Author: https://github.com/trflynn89
Commit: fd0011989a
Pull-request: https://github.com/SerenityOS/serenity/pull/9705
Reviewed-by: https://github.com/linusg ✅
2 changed files with 10 additions and 7 deletions
|
@ -591,13 +591,8 @@ static void transform_unicode_locale_id_to_canonical_syntax(LocaleID& locale_id)
|
|||
}
|
||||
|
||||
if (language_id.region.has_value()) {
|
||||
if (auto alias = resolve_territory_alias(*language_id.region); alias.has_value()) {
|
||||
auto aliases = alias->split_view(' ');
|
||||
|
||||
// FIXME: Territory subtag aliases should also consult the CLDR likelySubtags.json file.
|
||||
// For now, implement the spec's recommendation of using just the first alias.
|
||||
language_id.region = aliases[0].to_string();
|
||||
}
|
||||
if (auto alias = resolve_territory_alias(*language_id.region); alias.has_value())
|
||||
language_id.region = resolve_most_likely_territory(language_id, *alias);
|
||||
}
|
||||
|
||||
quick_sort(language_id.variants);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue