rsnext/examples/app-dir-i18n-routing/app/[lang]/layout.tsx
Jiachi Liu 0048908078
Remove legacy head.js in examples (#52292)
* Remove legacy `head.js` from examples and use `metadata` exports
instead
* Update the report template

---------
2023-07-05 16:42:36 -07:00

24 lines
510 B
TypeScript

import { i18n } from '../../i18n-config'
export async function generateStaticParams() {
return i18n.locales.map((locale) => ({ lang: locale }))
}
export default function Root({
children,
params,
}: {
children: React.ReactNode
params: { lang: string }
}) {
return (
<html lang={params.lang}>
<body>{children}</body>
</html>
)
}
export const metadata = {
title: 'i18n within app directory - Vercel Examples',
description: 'How to do i18n in Next.js 13 within app directory',
}