mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:57:45 +00:00
LibJS: Handle Unicode locale extensions in LookupMatcher AO
This commit is contained in:
parent
def8b44c40
commit
6f5fb87d3b
2 changed files with 44 additions and 11 deletions
|
@ -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");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue