auto translation setup

This commit is contained in:
2026-04-17 10:46:24 +02:00
parent e1efa898b4
commit dbeb294920
3 changed files with 46 additions and 19 deletions
+15
View File
@@ -0,0 +1,15 @@
import { getRequestConfig } from 'next-intl/server';
import { notFound } from 'next/navigation';
const locales = ['fr', 'en'];
export default getRequestConfig(async ({ requestLocale }) => {
const locale = await requestLocale;
if (!locale || !locales.includes(locale)) notFound();
return {
locale,
messages: (await import(`./messages/${locale}.json`)).default
};
});