diff --git a/src/app/i18n.ts b/src/app/i18n.ts new file mode 100644 index 0000000..3dd84ae --- /dev/null +++ b/src/app/i18n.ts @@ -0,0 +1,13 @@ +import { notFound } from 'next/navigation'; +import { getRequestConfig } from 'next-intl/server'; + +export const locales = ['en', 'fr', 'de', 'sv']; +export const defaultLocale = 'en'; + +export default getRequestConfig(async ({ locale }) => { + if (!locales.includes(locale as any)) notFound(); + + return { + messages: (await import(`../locales/${locale}.json`)).default + }; +}); \ No newline at end of file