Skip to content

Commit

Permalink
fix: matcher for translation middleware only supports en and de (#1528)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meierschlumpf authored Nov 23, 2024
1 parent 1fc48f9 commit 38143b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/translation/src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import createMiddleware from "next-intl/middleware";

import type { SupportedLanguage } from ".";
import { supportedLanguages } from "./config";
import { createRouting } from "./routing";

export const createI18nMiddleware = (defaultLocale: SupportedLanguage) =>
createMiddleware(createRouting(defaultLocale));

export const config = {
// Match only internationalized pathnames
matcher: ["/", "/(de|en)/:path*"],
matcher: ["/", `/(${supportedLanguages.join("|")})/:path*`],
};

0 comments on commit 38143b6

Please sign in to comment.