fix: matcher for translation middleware only supports en and de (#1528)

This commit is contained in:
Meier Lukas
2024-11-23 17:19:04 +01:00
committed by GitHub
parent 1fc48f9db0
commit 38143b679e

View File

@@ -1,6 +1,7 @@
import createMiddleware from "next-intl/middleware";
import type { SupportedLanguage } from ".";
import { supportedLanguages } from "./config";
import { createRouting } from "./routing";
export const createI18nMiddleware = (defaultLocale: SupportedLanguage) =>
@@ -8,5 +9,5 @@ export const createI18nMiddleware = (defaultLocale: SupportedLanguage) =>
export const config = {
// Match only internationalized pathnames
matcher: ["/", "/(de|en)/:path*"],
matcher: ["/", `/(${supportedLanguages.join("|")})/:path*`],
};