worked with lang subdir

This commit is contained in:
Al Murad Uzzaman
2024-05-19 17:40:46 +06:00
parent e2338efc6b
commit 340500efcc
10 changed files with 145 additions and 85 deletions
+2 -17
View File
@@ -1,5 +1,5 @@
import config from "@/config/config.json";
import languagesJSON from "@/config/language.json";
import config from "../../config/config.json";
import languagesJSON from "../../config/language.json";
import { getRelativeLocaleUrl } from "astro:i18n";
const { default_language } = config.settings;
@@ -29,21 +29,6 @@ export function getLangFromUrl(url: URL): string {
return default_language;
}
// export const getTranslations = async (lang: string) => {
// const menu = await import(
// `../../config/menu.${lang || default_language}.json`
// );
// const dictionary = await import(
// `../../i18n/${lang || default_language}.json`
// );
// return { ...menu, ...dictionary };
// };
// export const supportedLang = [""].concat(
// languagesJSON.map((lang) => lang.languageCode),
// );
// Function to construct the URL based on trailing_slash value
export const getTranslations = async (lang: string) => {
const {
default_language,