Skip to content

docs: add Simplified Chinese (zh-cn) documentation translation#74

Open
lrliang wants to merge 2 commits intobmad-code-org:mainfrom
lrliang:i18n/zh-cn-translation
Open

docs: add Simplified Chinese (zh-cn) documentation translation#74
lrliang wants to merge 2 commits intobmad-code-org:mainfrom
lrliang:i18n/zh-cn-translation

Conversation

@lrliang
Copy link
Copy Markdown

@lrliang lrliang commented Apr 13, 2026

What

Add complete Simplified Chinese (zh-cn) translations for all 19 documentation pages and configure Starlight i18n support.

Why

Expand documentation accessibility for Chinese-speaking users, consistent with the main BMad Method project which already provides zh-cn translations.

How

  • Translated all 19 docs (tutorials, how-to, explanation, reference) into docs/zh-cn/ following the Diataxis structure, matching the tone and terminology conventions of the main BMad Method zh-cn docs (智能体, 工作流, 技能, 模块, etc.)
  • Configured Starlight i18n: added locales.mjs, zh-CN.json UI strings, sidebar translations in astro.config.mjs, and i18nSchema in config.ts
  • Updated .gitignore to exempt docs/zh-cn/ from the z*/ exclusion pattern, and excluded zh-cn from build-docs.mjs LLM output
  • Added README_CN.md at the project root

Testing

Ran npm run docs:dev locally and manually verified all 19 zh-cn pages render correctly, sidebar navigation works with locale switcher, all internal relative links resolve without 404s, and external links point to zh-cn versions of docs.bmad-method.org.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Added extensive Simplified Chinese docs: explanations, tutorials, how‑tos, references, and a Chinese README to onboard Chinese-speaking users.
  • New Features

    • Full Chinese localization for the website and docs with i18n support and language selection, enabling users to read BMad Builder content in Simplified Chinese.

Add complete zh-cn translations for all 19 documentation pages following
the Diataxis structure, configure Starlight i18n support, and add a
Chinese README.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 24678585-7696-4a62-9f28-9e53cd674d14

📥 Commits

Reviewing files that changed from the base of the PR and between 60592e4 and f16b7ed.

📒 Files selected for processing (1)
  • website/astro.config.mjs

Walkthrough

This PR adds Simplified Chinese localization: new Chinese README and extensive docs under docs/zh-cn/, UI i18n strings and locale configuration, Starlight/collection wiring, and a build-tool exclusion so generated LLM context remains English-only.

Changes

Cohort / File(s) Summary
Gitignore Exception
\.gitignore
Added !docs/zh-cn/ exception so docs/zh-cn/ is tracked despite broader z*/ ignore.
Chinese README & Landing
README_CN.md, docs/zh-cn/index.md, docs/zh-cn/404.md
New Chinese README and site landing/404 pages.
Explanation Docs (zh-cn)
docs/zh-cn/explanation/*
Added multiple in-depth Chinese explanation pages (agents, skills, workflows, memory, subagent patterns, progressive disclosure, scripts, module configuration, best practices).
How-To / Reference (zh-cn)
docs/zh-cn/how-to/distribute-your-module.md, docs/zh-cn/reference/*
Added Chinese distribution guide and reference pages including builder-commands and workflow patterns.
Tutorials (zh-cn)
docs/zh-cn/tutorials/*
Added Chinese tutorial pages, including "build your first module".
Website i18n strings
website/src/content/i18n/zh-CN.json
New zh-CN UI translation JSON for site copy and labels.
Website locale module
website/src/lib/locales.mjs
New locales module exporting locales and translatedLocales (root + zh-cn).
Astro / Starlight config
website/astro.config.mjs, website/src/content/config.ts
Wired locales into Starlight config, added i18n collection using i18nSchema(), and added sidebar translation entries.
Build tool change
tools/build-docs.mjs
Added zh-cn to LLM_EXCLUDE_PATTERNS to keep generated LLM context English-only.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Author as Content Author
    participant Repo as Git Repository
    participant BuildTool as tools/build-docs.mjs
    participant Site as Astro/Starlight Website
    participant Browser as User Browser

    Author->>Repo: Add docs/zh-cn/* and i18n files
    Repo->>BuildTool: push triggers docs build
    BuildTool->>Repo: shouldExcludeFromLlm(path includes zh-cn) => true
    BuildTool-->>Site: release site with i18n config
    Site->>Site: load website/src/lib/locales.mjs and i18n collection
    Browser->>Site: request /zh-cn/ pages
    Site-->>Browser: serve localized pages and UI strings from zh-CN.json
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

  • #1978: README_CN.md and Chinese docs — this PR adds the README_CN and zh-cn docs referenced by the issue.
  • #1771: Chinese localization for docs/site — this PR implements zh-cn documentation and site i18n that the issue requests.

Possibly related PRs

  • #58: Updates sidebar/locales in Astro config — closely related to the sidebar locale entries added here.
  • #61: Distribution guide changes — related because this PR adds the Chinese translation of the distribution guide.

Poem

🐰
I hopped through files with nimble feet,
Zh-cn pages planted, tidy and neat.
Locales set, the site can sing,
Docs in Chinese take to wing.
Hooray, translations — fresh and sweet!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'docs: add Simplified Chinese (zh-cn) documentation translation' directly and accurately summarizes the main change: adding Chinese translations for documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (1)
docs/zh-cn/explanation/module-configuration.md (1)

162-186: Consider restructuring procedural content to align with explanation format.

This section provides step-by-step procedures for using Module Builder, which is more appropriate for a tutorial or how-to guide. Explanation documents should focus on clarifying concepts and describing how the system works rather than providing procedural instructions.

Consider rewriting to explain the conceptual differences between multi-skill and single-skill module creation approaches without numbered steps, or move the procedural content to a dedicated tutorial or how-to document.

As per coding guidelines, Markdown documentation must follow the Diataxis structure (tutorials, how-to, explanation, reference).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/zh-cn/explanation/module-configuration.md` around lines 162 - 186, This
section mixes procedural steps with conceptual explanation; remove the numbered
how-to steps and rewrite the Module Builder block to describe concepts and
differences (e.g., what Module Builder/bmad-module-builder does, the roles of
Ideate Module (IM), Create Module (CM) and Validate Module (VM), and how it
detects single-skill vs multi-skill inputs) and relocate the detailed sequences
for multi-skill and single-skill flows into a tutorial/how-to file; if you
prefer, keep a short conceptual summary mentioning Agent Builder (BA) and
Workflow Builder (BW) and note artifacts produced (e.g., module.yaml,
module-help.csv, assets/module-setup.md, marketplace.json) but remove the
step-by-step numbered procedures from this explanation doc.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.gitignore:
- Around line 45-46: The current .gitignore unignore rule only covers the
docs/zh-cn/ directory entry but not its nested contents because the broad z*/
pattern still ignores files under it; update .gitignore to also unignore all
nested files and subdirectories by adding a recursive unignore for docs/zh-cn
(e.g., add a rule referencing the existing !docs/zh-cn/ like !docs/zh-cn/**) so
that files inside docs/zh-cn/ are tracked properly.

In `@docs/zh-cn/404.md`:
- Line 8: Update the link in the Chinese 404 page so it points to the localized
homepage: replace the Markdown link target "[返回首页](../index.md)" in
docs/zh-cn/404.md with the path to the Chinese index (e.g., "../zh-cn/index.md"
or "./index.md" depending on repo structure) so users are routed to
docs/zh-cn/index.md rather than docs/index.md.

In `@docs/zh-cn/explanation/module-configuration.md`:
- Line 187: Update the incorrect relative link target "../what-are-modules.md"
in the string to point to the local file in the same directory by replacing it
with "./what-are-modules.md" (or "what-are-modules.md"); leave the existing
"../../reference/builder-commands.md" link unchanged. This change applies to the
text that currently reads "参见 **[什么是模块](../what-are-modules.md)** …".

In `@docs/zh-cn/explanation/progressive-disclosure.md`:
- Around line 109-110: Update the placeholder naming to match project convention
by replacing occurrences of '{project_root}' with '{project-root}' in the
examples (specifically the strings '{project_root}/docs/brief.md' and
'{project_root}/data/sources.json'); ensure any other instances in the same
document (progressive-disclosure.md) use '{project-root}' for consistency.

In `@docs/zh-cn/explanation/skill-authoring-best-practices.md`:
- Line 100: Replace the awkward phrase "最佳第三视角" with the clearer wording
"最佳的第三种视角" in the table cell that currently reads "| **情境化** | LLM
为该领域选择最佳第三视角(健康科技的监管风险、开发工具的 DX 评论家) |" so the sentence becomes "| **情境化** | LLM
为该领域选择最佳的第三种视角(健康科技的监管风险、开发工具的 DX 评论家) |". Ensure punctuation and spacing remain
consistent with the surrounding markdown.

In `@docs/zh-cn/explanation/what-are-skills.md`:
- Line 25: The two relative links in the sentence currently point to sibling
files using parent-directory paths (`../what-are-bmad-agents.md` and
`../what-are-workflows.md`) but the targets live in the same explanation
directory; update those link targets to use same-directory paths (e.g.,
`./what-are-bmad-agents.md` and `./what-are-workflows.md` or simply
`what-are-bmad-agents.md` and `what-are-workflows.md`) in
docs/zh-cn/explanation/what-are-skills.md so they resolve correctly.

In `@docs/zh-cn/explanation/what-are-workflows.md`:
- Line 69: The relative link target '../../reference/builder-commands.md' in the
"构建器命令参考" link is incorrect for the Chinese docs; update the Markdown link
target to '../reference/builder-commands.md' so it points to the Chinese
reference document while keeping the link text "构建器命令参考" unchanged.

In `@docs/zh-cn/how-to/distribute-your-module.md`:
- Line 21: Update the relative link `../../tutorials/build-your-first-module.md`
in the sentence "一个已完成并验证的 BMad 模块(参见
**[构建你的第一个模块](../../tutorials/build-your-first-module.md)**)" so it points to
the Chinese tutorial path `../tutorials/build-your-first-module.md` (i.e.,
`docs/zh-cn/tutorials/build-your-first-module.md`), ensuring the link targets
the localized `build-your-first-module.md` in the zh-cn docs.

In `@docs/zh-cn/index.md`:
- Line 92: The in-page link for "设计模式" uses the English fragment
`#design-patterns` which likely won't match the localized Chinese heading slug;
update the link in docs/zh-cn/index.md so the table entry either points to the
explanation index page (`./explanation/` or `./explanation/index.md`) or uses
the exact Chinese-generated anchor for the “设计模式” heading (replace
`./explanation/#design-patterns` with the correct localized fragment or the
index path), ensuring the visible text remains "设计模式".

---

Nitpick comments:
In `@docs/zh-cn/explanation/module-configuration.md`:
- Around line 162-186: This section mixes procedural steps with conceptual
explanation; remove the numbered how-to steps and rewrite the Module Builder
block to describe concepts and differences (e.g., what Module
Builder/bmad-module-builder does, the roles of Ideate Module (IM), Create Module
(CM) and Validate Module (VM), and how it detects single-skill vs multi-skill
inputs) and relocate the detailed sequences for multi-skill and single-skill
flows into a tutorial/how-to file; if you prefer, keep a short conceptual
summary mentioning Agent Builder (BA) and Workflow Builder (BW) and note
artifacts produced (e.g., module.yaml, module-help.csv, assets/module-setup.md,
marketplace.json) but remove the step-by-step numbered procedures from this
explanation doc.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 55dfb3d5-a2c0-4578-9b29-27c2d78eac1c

📥 Commits

Reviewing files that changed from the base of the PR and between f8b7930 and 60592e4.

📒 Files selected for processing (26)
  • .gitignore
  • README_CN.md
  • docs/zh-cn/404.md
  • docs/zh-cn/explanation/agent-memory-and-personalization.md
  • docs/zh-cn/explanation/index.md
  • docs/zh-cn/explanation/module-configuration.md
  • docs/zh-cn/explanation/progressive-disclosure.md
  • docs/zh-cn/explanation/scripts-in-skills.md
  • docs/zh-cn/explanation/skill-authoring-best-practices.md
  • docs/zh-cn/explanation/subagent-patterns.md
  • docs/zh-cn/explanation/what-are-bmad-agents.md
  • docs/zh-cn/explanation/what-are-modules.md
  • docs/zh-cn/explanation/what-are-skills.md
  • docs/zh-cn/explanation/what-are-workflows.md
  • docs/zh-cn/how-to/distribute-your-module.md
  • docs/zh-cn/index.md
  • docs/zh-cn/reference/builder-commands.md
  • docs/zh-cn/reference/index.md
  • docs/zh-cn/reference/workflow-patterns.md
  • docs/zh-cn/tutorials/build-your-first-module.md
  • docs/zh-cn/tutorials/index.md
  • tools/build-docs.mjs
  • website/astro.config.mjs
  • website/src/content/config.ts
  • website/src/content/i18n/zh-CN.json
  • website/src/lib/locales.mjs

Comment thread .gitignore
Comment thread docs/zh-cn/404.md
Comment thread docs/zh-cn/explanation/module-configuration.md
Comment thread docs/zh-cn/explanation/progressive-disclosure.md
Comment thread docs/zh-cn/explanation/skill-authoring-best-practices.md
Comment thread docs/zh-cn/explanation/what-are-skills.md
Comment thread docs/zh-cn/explanation/what-are-workflows.md
Comment thread docs/zh-cn/how-to/distribute-your-module.md
Comment thread docs/zh-cn/index.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant