- Add middleware.ts for locale detection (URL path, cookie, Accept-Language) - Update routing.ts to include en, de, fr locales - Update layout.tsx with NextIntlClientProvider and dynamic lang attribute - Create EN/DE/FR homepages, product listings, product details, about, and contact pages - Serbian remains at root URL (/products, /about, /contact) - English at /en/*, German at /de/*, French at /fr/*
16 lines
307 B
TypeScript
16 lines
307 B
TypeScript
import createMiddleware from "next-intl/middleware";
|
|
import { routing } from "./src/i18n/routing";
|
|
|
|
export default createMiddleware({
|
|
...routing,
|
|
localePrefix: "as-needed",
|
|
});
|
|
|
|
export const config = {
|
|
matcher: [
|
|
"/",
|
|
"/(sr|en|de|fr)/:path*",
|
|
"/((?!api|_next|_vercel|.*\\..*).*)",
|
|
],
|
|
};
|