[dyad] Fixing next-intl configuration error - wrote 2 file(s)
This commit is contained in:
10
src/i18n.ts
10
src/i18n.ts
@@ -1,12 +1,10 @@
|
||||
import {notFound} from 'next/navigation';
|
||||
import {getRequestConfig} from 'next-intl/server';
|
||||
|
||||
export const locales = ['en'];
|
||||
export const defaultLocale = 'en';
|
||||
|
||||
const locales = ['en'];
|
||||
|
||||
export default getRequestConfig(async ({locale}) => {
|
||||
if (!locales.includes(locale as any)) {
|
||||
locale = defaultLocale;
|
||||
}
|
||||
if (!locales.includes(locale as any)) notFound();
|
||||
|
||||
return {
|
||||
messages: (await import(`../messages/${locale}.json`)).default
|
||||
|
||||
@@ -6,5 +6,6 @@ export default createMiddleware({
|
||||
});
|
||||
|
||||
export const config = {
|
||||
matcher: ['/((?!api|_next|_vercel|.*\\..*).*)']
|
||||
// Match only internationalized pathnames
|
||||
matcher: ['/', '/(en)/:path*']
|
||||
};
|
||||
Reference in New Issue
Block a user