From ae8000bba23034be53f643b81947d3ef1d3a02e5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 12:48:41 +0000 Subject: [PATCH 1/5] Initial plan From 1656b11714c1cd58f439c124618c75f70b20e79a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 13:13:37 +0000 Subject: [PATCH 2/5] Changes before error encountered Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- apps/docs/app/[lang]/docs/layout.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/docs/app/[lang]/docs/layout.tsx b/apps/docs/app/[lang]/docs/layout.tsx index 0d2d7810d..7d21176c3 100644 --- a/apps/docs/app/[lang]/docs/layout.tsx +++ b/apps/docs/app/[lang]/docs/layout.tsx @@ -3,6 +3,7 @@ import type { Metadata } from 'next'; import { DocsLayout } from 'fumadocs-ui/layouts/docs'; import type { ReactNode } from 'react'; import { baseOptions } from '@/app/layout.config'; +import { i18n } from '@/lib/i18n'; export default async function Layout({ params, @@ -14,7 +15,11 @@ export default async function Layout({ const { lang } = await params; return ( - + {children} ); From 243250e8a436569b2d69f71589b52aa76a25b505 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 13:53:46 +0000 Subject: [PATCH 3/5] Add language switcher with i18n support for English and Chinese Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- apps/docs/app/[lang]/docs/layout.tsx | 3 +-- apps/docs/app/[lang]/layout.tsx | 12 +++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/docs/app/[lang]/docs/layout.tsx b/apps/docs/app/[lang]/docs/layout.tsx index 7d21176c3..06ecb816d 100644 --- a/apps/docs/app/[lang]/docs/layout.tsx +++ b/apps/docs/app/[lang]/docs/layout.tsx @@ -3,7 +3,6 @@ import type { Metadata } from 'next'; import { DocsLayout } from 'fumadocs-ui/layouts/docs'; import type { ReactNode } from 'react'; import { baseOptions } from '@/app/layout.config'; -import { i18n } from '@/lib/i18n'; export default async function Layout({ params, @@ -18,7 +17,7 @@ export default async function Layout({ {children} diff --git a/apps/docs/app/[lang]/layout.tsx b/apps/docs/app/[lang]/layout.tsx index 96dfd091f..bf89552d7 100644 --- a/apps/docs/app/[lang]/layout.tsx +++ b/apps/docs/app/[lang]/layout.tsx @@ -14,7 +14,17 @@ export default async function LanguageLayout({ return ( - {children} + ({ + name: l === 'en' ? 'English' : '中文', + locale: l, + })), + }} + > + {children} + ); From e1038ae1fbd3ab39f88614fe1831f46ba4e2ad23 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 13:57:06 +0000 Subject: [PATCH 4/5] Refactor language name mapping for better maintainability Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- apps/docs/app/[lang]/layout.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/docs/app/[lang]/layout.tsx b/apps/docs/app/[lang]/layout.tsx index bf89552d7..e2fcf3d95 100644 --- a/apps/docs/app/[lang]/layout.tsx +++ b/apps/docs/app/[lang]/layout.tsx @@ -2,6 +2,12 @@ import type { ReactNode } from 'react'; import { RootProvider } from 'fumadocs-ui/provider/next'; import { i18n } from '@/lib/i18n'; +// Language display names mapping +const LANGUAGE_NAMES: Record = { + en: 'English', + cn: '中文', +}; + export default async function LanguageLayout({ params, children, @@ -18,7 +24,7 @@ export default async function LanguageLayout({ i18n={{ locale: lang, locales: i18n.languages.map((l) => ({ - name: l === 'en' ? 'English' : '中文', + name: LANGUAGE_NAMES[l] || l, locale: l, })), }} From 494855a8b87dece7aa6229d48532fd2e696adf20 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 19 Jan 2026 14:18:31 +0000 Subject: [PATCH 5/5] Add language switcher to homepage for complete i18n support Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- apps/docs/app/[lang]/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/app/[lang]/page.tsx b/apps/docs/app/[lang]/page.tsx index bf40b3582..fc3c996fd 100644 --- a/apps/docs/app/[lang]/page.tsx +++ b/apps/docs/app/[lang]/page.tsx @@ -5,7 +5,7 @@ import { baseOptions } from '@/app/layout.config'; export default function HomePage() { return ( - +
{/* Hero Section */}