tags pages added

This commit is contained in:
Al Murad Uzzaman
2024-05-17 18:25:14 +06:00
parent c137b8afcd
commit 5c03211dfe
17 changed files with 229 additions and 144 deletions
+8 -4
View File
@@ -2,7 +2,7 @@ import config from "@/config/config.json";
import languagesJSON from "@/config/language.json";
import fs from "fs";
import path from "path";
const { defaultLang } = config.language;
const { default_language } = config.settings;
const menusFolderPath = "./src/config";
@@ -30,12 +30,16 @@ export function getLangFromUrl(url: URL): string {
if (locales.hasOwnProperty(lang)) {
return lang;
}
return defaultLang;
return default_language;
}
export const getTranslations = async (lang: string) => {
const menu = await import(`../../config/menu.${lang || defaultLang}.json`);
const dictionary = await import(`../../i18n/${lang || defaultLang}.json`);
const menu = await import(
`../../config/menu.${lang || default_language}.json`
);
const dictionary = await import(
`../../i18n/${lang || default_language}.json`
);
return { ...menu, ...dictionary };
};