feat: implement internationalization support by updating locale files and adding language switch component

This commit is contained in:
2025-06-08 09:25:38 +03:30
parent 2ae57940f0
commit 12775285ec
19 changed files with 148 additions and 333 deletions
+3 -5
View File
@@ -18,15 +18,13 @@ export default async function RootLayout({
params: ILayoutLocaleParams;
}>) {
const locale = params.locale;
console.log(locale);
let messages;
try {
console.log(await import(`../../../messages/en.json`));
messages = (await import(`../../../messages/en.json`)).default;
messages = (await import(`../../../messages/${locale}.json`)).default;
console.log('locale');
console.log(locale);
} catch (error) {
console.log(error);
notFound();
}