This commit is contained in:
2026-06-09 15:15:40 +03:00
parent f6b4acb760
commit d908d83ca5
58 changed files with 4320 additions and 419 deletions
+16
View File
@@ -0,0 +1,16 @@
import "server-only";
const dictionaries = {
en: () => import("../../dictionaries/en.json").then((module) => module.default),
tr: () => import("../../dictionaries/tr.json").then((module) => module.default),
};
export type Locale = keyof typeof dictionaries;
export const hasLocale = (locale: string): locale is Locale =>
locale in dictionaries;
export const getDictionary = async (locale: Locale) => {
if (!hasLocale(locale)) return dictionaries.tr();
return dictionaries[locale]();
};