[dyad] Fixing next-intl configuration error - wrote 2 file(s)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -6,5 +6,6 @@ export default createMiddleware({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
matcher: ['/((?!api|_next|_vercel|.*\\..*).*)']
|
// Match only internationalized pathnames
|
||||||
|
matcher: ['/', '/(en)/:path*']
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user