metadata added to pages
This commit is contained in:
1 parent
013f49be1e
commit
bd1dbe42f9
12 files changed
+214
-213
No files matched your search
@@ -1,19 +1,17 @@
|
||||
import { Dictionary } from "@/app/types/types";
|
||||
import "server-only";
|
||||
|
||||
const dictionaries: { [key: string]: () => Promise<any> } = {
|
||||
en: () =>
|
||||
import("../dictionaries/en.json").then((module) => module.default),
|
||||
fa: () =>
|
||||
import("../dictionaries/fa.json").then((module) => module.default),
|
||||
const dictionaries: { [key: string]: () => Promise<Dictionary> } = {
|
||||
en: () => import("../dictionaries/en.json").then((module) => module.default),
|
||||
fa: () => import("../dictionaries/fa.json").then((module) => module.default),
|
||||
};
|
||||
|
||||
export const getDictionary = async (
|
||||
locale: keyof typeof dictionaries,
|
||||
): Promise<any> => {
|
||||
const loadDictionary = dictionaries[locale];
|
||||
if (loadDictionary) {
|
||||
return loadDictionary();
|
||||
}
|
||||
throw new Error(`No dictionary found for locale: ${locale}`);
|
||||
};
|
||||
|
||||
locale: keyof typeof dictionaries,
|
||||
): Promise<Dictionary> => {
|
||||
const loadDictionary = dictionaries[locale];
|
||||
if (loadDictionary) {
|
||||
return loadDictionary();
|
||||
}
|
||||
throw new Error(`No dictionary found for locale: ${locale}`);
|
||||
};
|
||||
Reference in new issue
Block a user