nezha_dash/middleware.ts
2024-09-26 11:16:37 +08:00

22 lines
711 B
TypeScript

// @auto-i18n-check. Please do not delete the line.
import createMiddleware from "next-intl/middleware";
import { locales } from "./i18n-metadata";
export default createMiddleware({
// A list of all locales that are supported
locales: locales,
// Used when no locale matches
defaultLocale: "en",
// 'always': This is the default, The home page will also be redirected to the default language, such as www.abc.com to www.abc.com/en
// 'as-needed': The default page is not redirected. For example, if you open www.abc.com, it is still www.abc.com
localePrefix: "as-needed",
});
export const config = {
// Match only internationalized pathnames
matcher: ["/", "/(en|zh|zh-t|ja)/:path*"],
};