feat: add core i18n runtime and catalogs

This commit is contained in:
poyrazavsever
2026-07-19 03:06:38 +03:00
parent 0548820584
commit f4a2342ac4
12 changed files with 776 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
import { enUS, fr, tr } from "date-fns/locale";
export function getDateFnsLocale(locale: string) {
const normalized = locale.split("-")[0];
if (normalized === "tr") return tr;
if (normalized === "fr") return fr;
return enUS;
}
export function getDocumentDateFnsLocale() {
if (typeof document === "undefined") return tr;
return getDateFnsLocale(document.documentElement.lang || "tr");
}