feat(admin-i18n): add cookie-based locale runtime and switcher baseline
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { Metadata } from "next"
|
||||
import type { ReactNode } from "react"
|
||||
|
||||
import { getAdminMessages, resolveAdminLocale } from "@/i18n/server"
|
||||
import "./globals.css"
|
||||
import { Providers } from "./providers"
|
||||
|
||||
@@ -9,11 +10,16 @@ export const metadata: Metadata = {
|
||||
description: "Admin dashboard for the CMS monorepo",
|
||||
}
|
||||
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
export default async function RootLayout({ children }: { children: ReactNode }) {
|
||||
const locale = await resolveAdminLocale()
|
||||
const messages = await getAdminMessages(locale)
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
<html lang={locale}>
|
||||
<body>
|
||||
<Providers>{children}</Providers>
|
||||
<Providers locale={locale} messages={messages}>
|
||||
{children}
|
||||
</Providers>
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user