Add src/i18n.ts

This commit is contained in:
2026-06-03 21:33:52 +00:00
parent c9edddb904
commit 46b2da142f

11
src/i18n.ts Normal file
View File

@@ -0,0 +1,11 @@
import { getRequestConfig } from 'next-intl/server';
import { notFound } from 'next/navigation';
import { locales } from './config';
export default getRequestConfig(async ({ locale }) => {
if (!locales.includes(locale as any)) notFound();
return {
messages: (await import(`../messages/${locale}.json`)).default,
};
});