diff --git a/Tests/LibUnicode/TestUnicodeLocale.cpp b/Tests/LibUnicode/TestUnicodeLocale.cpp index 03f19695c0..85bf18dac2 100644 --- a/Tests/LibUnicode/TestUnicodeLocale.cpp +++ b/Tests/LibUnicode/TestUnicodeLocale.cpp @@ -312,6 +312,10 @@ TEST_CASE(canonicalize_unicode_locale_id) test("EN-U-KS-PRIMARY"sv, "en-u-ks-level1"sv); test("en-u-ka-primary"sv, "en-u-ka-primary"sv); test("EN-U-KA-PRIMARY"sv, "en-u-ka-primary"sv); + test("en-u-ms-imperial"sv, "en-u-ms-uksystem"sv); + test("EN-U-MS-IMPERIAL"sv, "en-u-ms-uksystem"sv); + test("en-u-ma-imperial"sv, "en-u-ma-imperial"sv); + test("EN-U-MA-IMPERIAL"sv, "en-u-ma-imperial"sv); test("en-t-en"sv, "en-t-en"sv); test("EN-T-EN"sv, "en-t-en"sv); @@ -333,6 +337,8 @@ TEST_CASE(canonicalize_unicode_locale_id) test("EN-T-K1-NAMES"sv, "en-t-k1-names"sv); test("en-t-k1-primary"sv, "en-t-k1-primary"sv); test("EN-T-K1-PRIMARY"sv, "en-t-k1-primary"sv); + test("en-t-k1-imperial"sv, "en-t-k1-imperial"sv); + test("EN-T-K1-IMPERIAL"sv, "en-t-k1-imperial"sv); test("en-0-aaa"sv, "en-0-aaa"sv); test("EN-0-AAA"sv, "en-0-aaa"sv); diff --git a/Userland/Libraries/LibUnicode/Locale.cpp b/Userland/Libraries/LibUnicode/Locale.cpp index db699778f0..5815f3678e 100644 --- a/Userland/Libraries/LibUnicode/Locale.cpp +++ b/Userland/Libraries/LibUnicode/Locale.cpp @@ -484,6 +484,7 @@ static void perform_hard_coded_key_value_substitutions(String& key, String& valu { // FIXME: In the XML export of CLDR, there are some aliases defined in the following files: // https://github.com/unicode-org/cldr-staging/blob/master/production/common/bcp47/collation.xml + // https://github.com/unicode-org/cldr-staging/blob/master/production/common/bcp47/measure.xml // https://github.com/unicode-org/cldr-staging/blob/master/production/common/bcp47/transform.xml // // There doesn't seem to be a counterpart in the JSON export. Since there aren't many such @@ -499,6 +500,8 @@ static void perform_hard_coded_key_value_substitutions(String& key, String& valu // but those are semantically incorrect values (they are too long), so they can be skipped. } else if ((key == "m0"sv) && (value == "names"sv)) { value = "prprname"sv; + } else if ((key == "ms"sv) && (value == "imperial"sv)) { + value = "uksystem"sv; } }