1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:17:35 +00:00

LibJS: Handle Unicode locale extensions in LookupMatcher AO

This commit is contained in:
Timothy Flynn 2021-08-30 08:51:52 -04:00 committed by Linus Groh
parent def8b44c40
commit 6f5fb87d3b
2 changed files with 44 additions and 11 deletions

View file

@ -28,4 +28,15 @@ describe("correct behavior", () => {
fallback: "code",
});
});
test("locales with extensions", () => {
const en = new Intl.DisplayNames("en-t-en", { type: "language" });
expect(en.resolvedOptions().locale).toBe("en");
const es419 = new Intl.DisplayNames("es-419-u-1k-aaa", { type: "language" });
expect(es419.resolvedOptions().locale).toBe("es-419");
const zhHant = new Intl.DisplayNames(["zh-Hant-x-aaa"], { type: "language" });
expect(zhHant.resolvedOptions().locale).toBe("zh-Hant");
});
});