fix: canonicalize widget date locales

This commit is contained in:
Thomas Camlong authored and ajnart committed 2026-08-14 11:07:08 +02:00
1 parent 2efa6bcd4c
commit 25b835dca9
9 files changed
+39 -11

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import { describe, expect, it } from "vitest";
import { getIntlLocale } from "./config";
describe("getIntlLocale", () => {
it("maps Homarr-specific locale keys to canonical Intl locales", () => {
expect(getIntlLocale("cn")).toBe("zh-CN");
expect(getIntlLocale("zh")).toBe("zh-TW");
expect(getIntlLocale("cr")).toBe("en");
});
it("preserves locale keys that Intl already understands", () => {
expect(getIntlLocale("fr")).toBe("fr");
expect(getIntlLocale("de-CH")).toBe("de-CH");
});
});