From 736804753a487914cef1c6fe1ea7ca671b2ae72f Mon Sep 17 00:00:00 2001 From: bender Date: Thu, 11 Jun 2026 20:58:12 +0000 Subject: [PATCH] Add src/app/i18n.ts --- src/app/i18n.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/app/i18n.ts 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