diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp index ce1cf5c402..9c0b397010 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp @@ -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) { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp index 130fb2eeda..1d26a62edd 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp @@ -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 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));