File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import type { Metadata } from 'next';
33import { DocsLayout } from 'fumadocs-ui/layouts/docs' ;
44import type { ReactNode } from 'react' ;
55import { baseOptions } from '@/app/layout.config' ;
6- import { i18n } from '@/lib/i18n' ;
76
87export default async function Layout ( {
98 params,
@@ -18,7 +17,7 @@ export default async function Layout({
1817 < DocsLayout
1918 tree = { source . pageTree [ lang ] }
2019 { ...baseOptions }
21- i18n = { i18n }
20+ i18n
2221 >
2322 { children }
2423 </ DocsLayout >
Original file line number Diff line number Diff line change @@ -14,7 +14,17 @@ export default async function LanguageLayout({
1414 return (
1515 < html lang = { lang } suppressHydrationWarning >
1616 < body >
17- < RootProvider > { children } </ RootProvider >
17+ < RootProvider
18+ i18n = { {
19+ locale : lang ,
20+ locales : i18n . languages . map ( ( l ) => ( {
21+ name : l === 'en' ? 'English' : '中文' ,
22+ locale : l ,
23+ } ) ) ,
24+ } }
25+ >
26+ { children }
27+ </ RootProvider >
1828 </ body >
1929 </ html >
2030 ) ;
You can’t perform that action at this time.
0 commit comments