Add src/app/i18n.ts

This commit is contained in:
2026-06-11 20:58:12 +00:00
parent 745f9eb7f4
commit 736804753a

13
src/app/i18n.ts Normal file
View File

@@ -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
};
});