Add i18n support with Next.js App Router and Dictionaries
This commit is contained in:
30
app/[lang]/layout.tsx
Normal file
30
app/[lang]/layout.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { Metadata } from "next";
|
||||
import "../globals.css";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "AyrisMail Central",
|
||||
description: "Multi-tenant Mailcow yönetim paneli — AyrisTech",
|
||||
};
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return [{ lang: "tr" }, { lang: "en" }];
|
||||
}
|
||||
|
||||
export default async function RootLayout(
|
||||
props: {
|
||||
children: React.ReactNode;
|
||||
params: Promise<{ lang: string }>;
|
||||
}
|
||||
) {
|
||||
const params = await props.params;
|
||||
|
||||
const {
|
||||
children
|
||||
} = props;
|
||||
|
||||
return (
|
||||
<html lang={params.lang}>
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user