mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +00:00
LibJS+LibUnicode: Parse Unicode keywords from the BCP 47 CLDR package
We have a fair amount of hard-coded keywords / aliases that can now be replaced with real data from BCP 47. As a result, the also changes the awkward way we were previously generating keys. Before, we were more or less generating keywords as a CSV list of keys, e.g. for the "nu" key, we'd generate "latn,arab,grek" (ordered by locale preference). Then at runtime, we'd split on the comma. We now just generate spans of keywords directly.
This commit is contained in:
parent
d0fc61e79b
commit
89ead8c00a
6 changed files with 236 additions and 121 deletions
|
@ -427,7 +427,7 @@ LocaleResult resolve_locale(Vector<String> const& requested_locales, LocaleOptio
|
|||
// b. Assert: Type(foundLocaleData) is Record.
|
||||
// c. Let keyLocaleData be foundLocaleData.[[<key>]].
|
||||
// d. Assert: Type(keyLocaleData) is List.
|
||||
auto key_locale_data = Unicode::get_locale_key_mapping_list(found_locale, key);
|
||||
auto key_locale_data = Unicode::get_keywords_for_locale(found_locale, key);
|
||||
|
||||
// e. Let value be keyLocaleData[0].
|
||||
// f. Assert: Type(value) is either String or Null.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue