language i18n added and tested for server and client side
This commit is contained in:
33
ServicesFrontEnd/frontend/middleware.ts
Normal file
33
ServicesFrontEnd/frontend/middleware.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
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|.*\\..*).*)"],
|
||||
};
|
||||
Reference in New Issue
Block a user