Implement i18n with German and English support (default DE)
This commit is contained in:
9
get-dictionary.ts
Normal file
9
get-dictionary.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import "server-only";
|
||||
|
||||
const dictionaries = {
|
||||
en: () => import("./dictionaries/en.json").then((module) => module.default),
|
||||
de: () => import("./dictionaries/de.json").then((module) => module.default),
|
||||
};
|
||||
|
||||
export const getDictionary = async (locale: keyof typeof dictionaries) =>
|
||||
dictionaries[locale]();
|
||||
Reference in New Issue
Block a user