@pelag/nts
Version:
Creation and support of the multilingual project Next.js
30 lines (24 loc) • 717 B
Plain Text
import { ReactNode } from "react";
import type { Metadata } from "next";
import { langConfig, type Locale } from "{{LANG_CONFIG_PATH}}";
import "./globals.css";
export const metadata: Metadata = {
title: "NextJs",
description: "NextJs + next-translator",
};
export const generateStaticParams = async () => {
return langConfig.locales.map((locale) => ({ lang: locale }));
}
interface Props {
children: ReactNode;
params: Promise<{ lang: Locale }>;
}
export default async function RootLayout(props: Readonly<Props>) {
const params = await props.params;
const { children } = props;
return (
<html lang={params.lang}>
<body>{children}</body>
</html>
);
}