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

+8
View File
@@ -438,5 +438,13 @@ export type LanguageIconDefinition =
export { fallbackLocale } from "./languages";
const intlLocaleOverrides: Partial<Record<SupportedLanguage, string>> = {
cn: "zh-CN",
cr: "en",
zh: "zh-TW",
};
export const getIntlLocale = (locale: SupportedLanguage): string => intlLocaleOverrides[locale] ?? locale;
export const isLocaleRTL = (locale: SupportedLanguage) =>
"isRTL" in localeConfigurations[locale] && localeConfigurations[locale].isRTL;