Add src/i18n.ts

This commit is contained in:
2026-06-09 18:14:05 +00:00
parent 6fb7e95ae6
commit 1e2b792f1b

12
src/i18n.ts Normal file
View File

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