fix: matcher for translation middleware only supports en and de (#1528)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import createMiddleware from "next-intl/middleware";
|
import createMiddleware from "next-intl/middleware";
|
||||||
|
|
||||||
import type { SupportedLanguage } from ".";
|
import type { SupportedLanguage } from ".";
|
||||||
|
import { supportedLanguages } from "./config";
|
||||||
import { createRouting } from "./routing";
|
import { createRouting } from "./routing";
|
||||||
|
|
||||||
export const createI18nMiddleware = (defaultLocale: SupportedLanguage) =>
|
export const createI18nMiddleware = (defaultLocale: SupportedLanguage) =>
|
||||||
@@ -8,5 +9,5 @@ export const createI18nMiddleware = (defaultLocale: SupportedLanguage) =>
|
|||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
// Match only internationalized pathnames
|
// Match only internationalized pathnames
|
||||||
matcher: ["/", "/(de|en)/:path*"],
|
matcher: ["/", `/(${supportedLanguages.join("|")})/:path*`],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user