From dbeb294920e7060285897dce36a50407847df6c7 Mon Sep 17 00:00:00 2001 From: Matheo Guilbert Date: Fri, 17 Apr 2026 10:46:24 +0200 Subject: [PATCH] auto translation setup --- app/[locale]/layout.tsx | 45 ++++++++++++++++++++++++----------------- i18n.ts | 15 ++++++++++++++ next.config.ts | 5 ++++- 3 files changed, 46 insertions(+), 19 deletions(-) create mode 100644 i18n.ts diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index a6840dc..c341b9c 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -1,5 +1,7 @@ import type { Metadata } from "next"; import { Playfair_Display, Inter } from "next/font/google"; +import { NextIntlClientProvider } from "next-intl"; +import { getMessages } from 'next-intl/server'; import "./globals.css"; @@ -22,28 +24,35 @@ export const metadata: Metadata = { description: "Portfolio de Mathéo Guilbert, développeur web freelance.", }; -export default function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode; -}>) { +export default async function RootLayout({ + children, + params, +}: { + children: React.ReactNode; + params: Promise<{ locale: string }>; +}) { + const { locale } = await params; + const messages = await getMessages(); + return ( - + -
-
-
- - {/* Scrolling bloc */} - -
- {children} -
+ +
+
+
-