From 30922a25bb2ecee2040b80d2794275e4c8fe5e52 Mon Sep 17 00:00:00 2001 From: cfngc4594 Date: Mon, 14 Apr 2025 22:43:27 +0800 Subject: [PATCH] feat(i18n): integrate next-intl and dynamic locale support in RootLayout --- src/app/layout.tsx | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 2b613f4..d50795c 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,6 +1,8 @@ import "@/app/globals.css"; import { Toaster } from "sonner"; import type { Metadata } from "next"; +import { getLocale } from "next-intl/server"; +import { NextIntlClientProvider } from "next-intl"; import { ThemeProvider } from "@/components/theme-provider"; import { SettingsDialog } from "@/components/settings-dialog"; @@ -14,20 +16,24 @@ interface RootLayoutProps { children: React.ReactNode; } -export default function RootLayout({ children }: RootLayoutProps) { +export default async function RootLayout({ children }: RootLayoutProps) { + const locale = await getLocale(); + return ( - + - -
{children}
- - -
+ + +
{children}
+ + +
+
);