[dyad] Fixing next-intl configuration error - wrote 2 file(s)

This commit is contained in:
[dyad]
2026-01-18 16:47:17 +01:00
parent 42b6408f00
commit 84466478ff
2 changed files with 6 additions and 7 deletions

View File

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

View File

@@ -6,5 +6,6 @@ export default createMiddleware({
}); });
export const config = { export const config = {
matcher: ['/((?!api|_next|_vercel|.*\\..*).*)'] // Match only internationalized pathnames
matcher: ['/', '/(en)/:path*']
}; };