Skip to content

docs: add Simplified Chinese (zh-CN) documentation#27

Open
lrliang wants to merge 2 commits intobmad-code-org:mainfrom
lrliang:feat/add-chinese-docs
Open

docs: add Simplified Chinese (zh-CN) documentation#27
lrliang wants to merge 2 commits intobmad-code-org:mainfrom
lrliang:feat/add-chinese-docs

Conversation

@lrliang
Copy link
Copy Markdown

@lrliang lrliang commented Apr 13, 2026

What

Add full Simplified Chinese (zh-CN) documentation translation covering all 19 pages, along with the Starlight i18n infrastructure to support it.

Why

Expand documentation accessibility for Chinese-speaking users, consistent with the i18n pattern already established in the BMAD-METHOD main project.

How

  • Created docs/zh-cn/ with 19 translated markdown files mirroring the English docs structure (tutorials, how-to, explanation, reference)
  • Added Starlight i18n config (locales.mjs, zh-CN.json UI strings, sidebar translations in astro.config.mjs, i18n schema in config.ts)
  • Updated tools/build-docs.mjs to exclude zh-cn/ from llms-full.txt generation
  • Fixed .gitignore z*//z*/ so it no longer matches docs/zh-cn/
  • Fixed pre-existing bare URL lint error in README.md

Testing

Verified locally with npm run docs:dev — Chinese docs render at /zh-cn/, language switcher works, sidebar labels display in Chinese, and all internal links resolve correctly without 404s.

Add full Chinese translation for all 19 documentation pages, matching
the i18n pattern established in the BMAD-METHOD main project.

Infrastructure changes:
- Add Starlight i18n locale config (locales.mjs, zh-CN.json UI strings)
- Update astro.config.mjs with locale support and sidebar translations
- Update content config with i18n schema
- Exclude zh-cn/ from llms-full.txt in build pipeline
- Fix .gitignore z*/ pattern to only match repo root
- Fix bare URL lint error in README.md

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

coderabbitai bot commented Apr 13, 2026

Warning

Rate limit exceeded

@lrliang has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 3 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 4 minutes and 3 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7983fbba-eb29-464d-9fb8-b8a0a68e1e13

📥 Commits

Reviewing files that changed from the base of the PR and between 740b1e8 and bdc39b2.

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

Walkthrough

This PR adds comprehensive Simplified Chinese documentation for the Creative Intelligence Suite across tutorials, how-tos, explanations, and reference sections. It introduces internationalization infrastructure including locale configuration, sidebar translations, and Chinese UI strings for the Starlight documentation site.

Changes

Cohort / File(s) Summary
Chinese Documentation - Tutorials & Guides
docs/zh-cn/404.md, docs/zh-cn/index.md, docs/zh-cn/tutorials/..., docs/zh-cn/how-to/...
New Chinese content pages covering getting started, brainstorming, design thinking, innovation strategy, problem solving, and storytelling workflows with step-by-step instructions, examples, and best practices.
Chinese Documentation - Concepts & References
docs/zh-cn/explanation/..., docs/zh-cn/reference/...
New Chinese reference documentation explaining creative intelligence, brainstorming techniques, design thinking phases, innovation frameworks, agents, workflows, and configuration options.
Internationalization Setup
website/src/lib/locales.mjs, website/src/content/i18n/zh-CN.json, website/src/content/config.ts
Added i18n infrastructure: exported locales and translatedLocales constants, Chinese (zh-CN) UI string translations for Starlight components (search, theme, navigation, accessibility labels, etc.), and new i18n collection in Astro Content configuration.
Website Configuration
website/astro.config.mjs
Updated Starlight config to import locales module and set defaultLocale: 'root' with i18n configuration; added translations maps for Chinese labels on main sidebar sections (Welcome, Tutorials, How-To Guides, Explanation, Reference).
Build Infrastructure
tools/build-docs.mjs
Added TRANSLATED_LOCALE_DIRS constant and extended shouldExcludeFromLlm() function to exclude translated locale directories from LLM indexing.
Minor Updates
.gitignore, README.md
Updated .gitignore path anchor from z*/ to /z*/; changed "Support BMad" email in README.md to HTML link format.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Poem

🐰 A warren of words in a new tongue takes root,
Zh-cn paths now guide seekers through creative pursuits.
From Carson to Victor, the agents all speak,
In flowing Mandarin—translation complete!
The locales are set, the i18n is done,
More minds to inspire when this phase has begun. 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding complete Simplified Chinese documentation and i18n infrastructure to the project.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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.

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.

🧹 Nitpick comments (1)
tools/build-docs.mjs (1)

39-42: Avoid locale drift by importing translated locales from the shared config.

This local hardcoded list can diverge from website/src/lib/locales.mjs. Reuse translatedLocales as the single source of truth.

♻️ Proposed refactor
 import { fileURLToPath } from 'node:url';
 import { getSiteUrl } from '../website/src/lib/site-url.mjs';
+import { translatedLocales } from '../website/src/lib/locales.mjs';
@@
-const TRANSLATED_LOCALE_DIRS = ['zh-cn'];
+const TRANSLATED_LOCALE_DIRS = translatedLocales;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/build-docs.mjs` around lines 39 - 42, Replace the hardcoded
TRANSLATED_LOCALE_DIRS array with a derived value from the shared
translatedLocales export: import the translatedLocales symbol and compute
TRANSLATED_LOCALE_DIRS by filtering translatedLocales to exclude the English key
(e.g., 'en' or the default locale) and mapping to the locale directory keys used
by the build; update any references to TRANSLATED_LOCALE_DIRS in
tools/build-docs.mjs to use this derived constant so the script stays in sync
with the single source of truth (translatedLocales).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tools/build-docs.mjs`:
- Around line 39-42: Replace the hardcoded TRANSLATED_LOCALE_DIRS array with a
derived value from the shared translatedLocales export: import the
translatedLocales symbol and compute TRANSLATED_LOCALE_DIRS by filtering
translatedLocales to exclude the English key (e.g., 'en' or the default locale)
and mapping to the locale directory keys used by the build; update any
references to TRANSLATED_LOCALE_DIRS in tools/build-docs.mjs to use this derived
constant so the script stays in sync with the single source of truth
(translatedLocales).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 25d41b53-11bc-4970-94a6-fe1671d25131

📥 Commits

Reviewing files that changed from the base of the PR and between 35f47c3 and 740b1e8.

📒 Files selected for processing (26)
  • .gitignore
  • README.md
  • docs/zh-cn/404.md
  • docs/zh-cn/explanation/brainstorming-techniques.md
  • docs/zh-cn/explanation/creative-intelligence.md
  • docs/zh-cn/explanation/design-thinking-phases.md
  • docs/zh-cn/explanation/index.md
  • docs/zh-cn/explanation/innovation-frameworks.md
  • docs/zh-cn/how-to/brainstorm.md
  • docs/zh-cn/how-to/design-thinking.md
  • docs/zh-cn/how-to/index.md
  • docs/zh-cn/how-to/innovation-strategy.md
  • docs/zh-cn/how-to/problem-solving.md
  • docs/zh-cn/how-to/storytelling.md
  • docs/zh-cn/index.md
  • docs/zh-cn/reference/agents.md
  • docs/zh-cn/reference/configuration.md
  • docs/zh-cn/reference/index.md
  • docs/zh-cn/reference/workflows.md
  • docs/zh-cn/tutorials/getting-started.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

@lrliang
Copy link
Copy Markdown
Author

lrliang commented Apr 13, 2026

@alexeyv @bmadcode please check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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