mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibUnicode: Parse alternate default numbering systems
Some locales in the CLDR have alternate default numbering systems listed under "defaultNumberingSystem-alt-*", e.g.: "defaultNumberingSystem": "arab", "defaultNumberingSystem-alt-latn": "latn", "otherNumberingSystems": { "native": "arab" }, We were previously only parsing "defaultNumberingSystem" and "otherNumberingSystems". This odd format appears to be an artifact of converting from XML.
This commit is contained in:
parent
ae66188d43
commit
d3e83c9934
Notes:
sideshowbarker
2024-07-18 01:15:46 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/d3e83c99342 Pull-request: https://github.com/SerenityOS/serenity/pull/10873 Reviewed-by: https://github.com/linusg
1 changed files with 9 additions and 0 deletions
|
@ -454,6 +454,15 @@ static void parse_numeric_keywords(String locale_numbers_path, UnicodeLocaleData
|
|||
keyword_values.append(move(keyword_value));
|
||||
});
|
||||
|
||||
locale_numbers_object.as_object().for_each_member([&](auto const& key, JsonValue const& value) {
|
||||
if (!key.starts_with("defaultNumberingSystem-alt-"sv))
|
||||
return;
|
||||
|
||||
auto keyword_value = value.as_string();
|
||||
if (!keyword_values.contains_slow(keyword_value))
|
||||
keyword_values.append(move(keyword_value));
|
||||
});
|
||||
|
||||
StringBuilder builder;
|
||||
builder.join(',', keyword_values);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue