mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
LibJS: Remove hard-coded lists of collation types
Working around not having collation data in the CLDR now handled in the Unicode generators.
This commit is contained in:
parent
f8f7015419
commit
c657f23e6f
2 changed files with 2 additions and 5 deletions
|
@ -120,9 +120,7 @@ JS_DEFINE_NATIVE_FUNCTION(Intl::supported_values_of)
|
|||
// 3. Else if key is "collation", then
|
||||
else if (key == "collation"sv) {
|
||||
// a. Let list be ! AvailableCollations( ).
|
||||
// FIXME: We don't yet parse any collation data, but "default" is allowed. This matches Intl.Locale.prototype.collations.
|
||||
static constexpr auto collations = AK::Array { "default"sv };
|
||||
list = collations.span();
|
||||
list = Unicode::get_available_collation_types();
|
||||
}
|
||||
// 4. Else if key is "currency", then
|
||||
else if (key == "currency"sv) {
|
||||
|
|
|
@ -103,8 +103,7 @@ Array* collations_of_locale(GlobalObject& global_object, Locale const& locale_ob
|
|||
VERIFY(Unicode::parse_unicode_locale_id(locale).has_value());
|
||||
|
||||
// 4. Let list be a List of 1 or more unique canonical collation identifiers, which must be lower case String values conforming to the type sequence from UTS 35 Unicode Locale Identifier, section 3.2, sorted in descending preference of those in common use for string comparison in locale. The values "standard" and "search" must be excluded from list.
|
||||
// FIXME: Retrieve this data from the CLDR when we fully support collation. This matches Intl.supportedValuesOf.
|
||||
Vector<StringView> list { "default"sv };
|
||||
auto list = Unicode::get_keywords_for_locale(locale, "co"sv);
|
||||
|
||||
// 5. Return ! CreateArrayFromListOrRestricted( list, restricted ).
|
||||
return create_array_from_list_or_restricted(global_object, move(list), move(restricted));
|
||||
|
|
Loading…
Add table
Reference in a new issue