mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 08:50:56 +01:00
14 lines
448 B
TypeScript
14 lines
448 B
TypeScript
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: ["/", `/(${supportedLanguages.join("|")})/:path*`],
|
|
};
|