Skip to content

chore(theme-translations): complete zh-Hans translations (AI-assisted) - #12828

Open
DU8866-nice wants to merge 1 commit into
meta:mainfrom
DU8866-nice:theme-translations-zh-hans
Open

DU8866-nice wants to merge 1 commit into
meta:mainfrom
DU8866-nice:theme-translations-zh-hans

Conversation

@DU8866-nice

@DU8866-nice DU8866-nice commented Nov 1, 2026 •

Copy link
Copy Markdown

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior. (Not a code change: translations only.)
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan. (Not applicable.)

Motivation

28 zh-Hans theme messages were still in English, most of them the DocSearch Ask AI strings, so a zh-Hans site showed English text in the search modal, the live code block reset button and some ARIA labels. This PR translates them.

It also fixes theme.docs.paginator.navAriaLabel, which was translated as "文件选项卡" ("file tabs"). It is now "文档分页导航", matching the blog paginator label "博文分页导航".

Left in English on purpose:

  • theme.SearchModal.searchBox.enterKeyHint and enterKeyHintAskAi: their values (search, enter) are keywords of the HTML enterkeyhint attribute, which only accepts fixed values.
  • theme.blog.author.pageTitle: it only contains placeholders.

AI disclosure: the translations were drafted with Claude Code (Claude Opus 5.5) and reviewed by me, a native Chinese speaker.

Test Plan

Only message values in locales/zh-Hans/*.json change. No message ids are added or removed, and every {placeholder} from the base messages is kept.

Related issues/PRs

Follows earlier zh-Hans translation updates such as #10816 and #9321.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WkzcU6qKakM6jvCoN7F1pQ

Summary by CodeRabbit

  • Localization
    • Updated Simplified Chinese labels for external links, color mode, documentation navigation, and mobile dropdown controls.
    • Translated the live-code reset button.
    • Updated Simplified Chinese search labels, AI controls, recent-conversation text, and related prompts.

Translate the zh-Hans theme messages that were still in English, mostly
the DocSearch Ask AI strings, and fix the docs paginator ARIA label, which
was translated as "文件选项卡" (file tabs) instead of a pagination label.
@meta-cla

meta-cla Bot commented Nov 1, 2026

Copy link
Copy Markdown

Hi @DU8866-nice!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 24051118-5b64-49c1-9606-82b2fa56470e
Commits

Reviewing files that changed from the base of the PR and between 6531677 and 0869e62.

Files selected for processing: 3
  • packages/docusaurus-theme-translations/locales/zh-Hans/theme-common.json
  • packages/docusaurus-theme-translations/locales/zh-Hans/theme-live-codeblock.json
  • packages/docusaurus-theme-translations/locales/zh-Hans/theme-search-algolia.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The Chinese Simplified locale replaces English or inaccurate wording in common theme labels, the live code block reset button, and Algolia search labels.

Changes: Simplified Chinese theme translations

Layer / File(s) Summary
Common theme labels
packages/docusaurus-theme-translations/locales/zh-Hans/theme-common.json, packages/docusaurus-theme-translations/locales/zh-Hans/theme-live-codeblock.json
External-link, color-mode, paginator, mobile dropdown, and reset-button labels now use Chinese wording.
Algolia search labels
packages/docusaurus-theme-translations/locales/zh-Hans/theme-search-algolia.json
AI controls, prompts, search navigation, input and streaming placeholders, and recent-conversation labels now use Chinese wording. Existing Chinese strings and key hints remain unchanged.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Merge Risk: Minimal · up to 0869e

The translations improve Chinese UI text. No actionable merge-blocking risk was identified.

Architecture risk: Low · up to 0869e

The change affects 1 system.

Changed systems: packages/docusaurus-theme-translations

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/docusaurus-theme-translations (library) was modified; 3 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/docusaurus-theme-translations/locales/zh-Hans/theme-common.json: The external-link accessibility label is now Chinese for opening a link in a new tab, replacing the English text.
  • observed — Modified behavior in packages/docusaurus-theme-translations/locales/zh-Hans/theme-common.json: The system color-mode label is now “跟随系统” instead of the English “system mode.”
  • observed — Modified behavior in packages/docusaurus-theme-translations/locales/zh-Hans/theme-common.json: The documentation paginator navigation label now identifies document pagination instead of file tabs.
  • observed — Modified behavior in packages/docusaurus-theme-translations/locales/zh-Hans/theme-common.json: The mobile dropdown collapse and expand accessibility labels are now Chinese, replacing their English text.
Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: completing Simplified Chinese theme translations. The scope matches the files and objectives.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@netlify

netlify Bot commented Nov 1, 2026

Copy link
Copy Markdown

✅ [V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 0869e62
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6ae68579ff0355a4e397b333
😎 Deploy Preview https://deploy-preview-12828--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@meta-cla

meta-cla Bot commented Nov 1, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the CLA Signed Signed Facebook CLA label Nov 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant