Add next-intl to internationalize our project

This commit is contained in:
2026-02-03 15:11:59 +01:00
parent a073665dc4
commit 85b618836b
25 changed files with 1103 additions and 180 deletions

45
app/[locale]/layout.tsx Normal file
View File

@@ -0,0 +1,45 @@
import { routing } from "@/i18n/routing";
import type { Metadata } from "next";
import { NextIntlClientProvider } from "next-intl";
import { ThemeProvider } from "next-themes";
import { Geist, Geist_Mono } from "next/font/google";
import "../globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: "CGR App",
description: "Manager for CGR Data",
};
export default async function RootLayout({
children,
params,
}: Readonly<{
children: React.ReactNode;
params: { locale?: string };
}>) {
const { locale } = await params;
return (
<html lang={locale || routing.defaultLocale} suppressHydrationWarning>
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
<ThemeProvider attribute="class" enableSystem>
<NextIntlClientProvider locale={locale || routing.defaultLocale}>
{children}
</NextIntlClientProvider>
</ThemeProvider>
</body>
</html>
);
}