feat: phase 1 - i18n core infrastructure with EN/DE/FR locales
- 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/*
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import "./globals.css";
|
||||
import type { Metadata, Viewport } from "next";
|
||||
import ErrorBoundary from "@/components/providers/ErrorBoundary";
|
||||
import { NextIntlClientProvider } from "next-intl";
|
||||
import { getMessages } from "next-intl/server";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: {
|
||||
@@ -23,19 +25,25 @@ export const viewport: Viewport = {
|
||||
maximumScale: 5,
|
||||
};
|
||||
|
||||
// Suppress extension-caused hydration warnings
|
||||
const suppressHydrationWarning = true;
|
||||
|
||||
export default function RootLayout({
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
params,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
params: Promise<{ locale: string }>;
|
||||
}) {
|
||||
const { locale } = await params;
|
||||
const messages = await getMessages();
|
||||
|
||||
return (
|
||||
<html lang="en" suppressHydrationWarning>
|
||||
<html lang={locale} suppressHydrationWarning>
|
||||
<body className="antialiased" suppressHydrationWarning>
|
||||
<ErrorBoundary>
|
||||
{children}
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
{children}
|
||||
</NextIntlClientProvider>
|
||||
</ErrorBoundary>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user