File conventions

Locale segment root layout

A root layout can live under app/[lang] when all application pages are inside that segment. It owns html and body; do not nest a second document layout beneath another root. Await params and allowlist supported locales. This English-only example rejects every locale other than en. No translation is implied. Source: https://nextjs.org/docs/app/guides/internationalization. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.

Formal Syntax & Structure

nextjs syntaxnextjs
app/[lang]/layout.tsx

Working Example

Example Snippetnextjs
import {notFound} from 'next/navigation';export default async function Layout({children,params}:{children:React.ReactNode;params:Promise<{lang:string}>}){ const {lang}=await params; if(lang!=='en') notFound(); return <html lang='en' dir='ltr'><body>{children}</body></html>;}
Next.js Reference