34 lines
759 B
TypeScript
34 lines
759 B
TypeScript
import createMiddleware from "next-intl/middleware";
|
|
import { routing } from "@/i18n/routing";
|
|
|
|
export default createMiddleware({
|
|
// A list of all locales that are supported
|
|
locales: routing.locales,
|
|
|
|
// Used when no locale matches
|
|
defaultLocale: routing.defaultLocale,
|
|
|
|
// Locale detection strategies
|
|
localeDetection: true,
|
|
|
|
// Uncomment to use domains for language-specific subdomains
|
|
// domains: [
|
|
// {
|
|
// domain: 'example.com',
|
|
// defaultLocale: 'en'
|
|
// },
|
|
// {
|
|
// domain: 'example.fr',
|
|
// defaultLocale: 'fr'
|
|
// }
|
|
// ]
|
|
});
|
|
|
|
export const config = {
|
|
// Match all pathnames except for
|
|
// - API routes
|
|
// - Static files
|
|
// - _next internal paths
|
|
matcher: ["/((?!api|_next|.*\\..*).*)"],
|
|
};
|