Skip to content

feat(locales): translate the keys the Chinese catalog is missing - #989

Open
oisano (oisano11) wants to merge 2 commits into
JetBrains:mainfrom
oisano11:translate-remaining-zh-cn
Open

oisano (oisano11) wants to merge 2 commits into
JetBrains:mainfrom
oisano11:translate-remaining-zh-cn

Conversation

@oisano11

@oisano11 oisano (oisano11) commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes the gap between en.json and the bundled zh-CN.json on current main: 2630 keys in English, 2532 in Chinese. A missing key falls back to English silently, because check:i18n validates en.json only, so the Chinese interface has been drifting toward half-English as the app grew.

The gaps are strings added or rewritten upstream after the catalog was last completed in #871: the connect-a-provider and onboarding surfaces, the new-project dialog, custom themes, analytics consent, the auth prompt fragments, and the background-work dock and inspector that #1004 added. Nothing was lost in a merge; these keys post-date the translations.

Two commits, one file, +98 lines.

Changes

  • packages/locales/zh-CN.json: 2532 → 2630 keys, every key en.json declares. validateCatalog drops nothing, so the coverage is real rather than nominal.
  • Both plural families (panels.connectProvider.modelsAvailable_*, panels.welcome.connectedModels_*) get _one and _other, following how the other bundled catalogs are written even though Intl.PluralRules("zh-CN") only resolves other.

Terminology follows what the catalog already settled on: provider 提供方, host/agent/spec/Skill left as-is, subagent 子 agent, finished 已结束, workspace 工作区, plan (the subscription) 套餐, repo 仓库, and — (spaced em dash) rather than ——. Address forms split the way the file already splits them: 您 in the longer explanatory copy, 你 in short status lines.

Strings that needed care:

  • auth.login.promptBlankFor is spliced mid-sentence by loginOptions.ts:28, which is why the English value deliberately starts with .; the Chinese starts with 。 to match.
  • settings.appearance.custom.steps keeps its <0>dark.theme.json</0> marker, which CustomThemesSettings.tsx renders as a clickable example.
  • resources.inspector.foldLabel and resources.inspector.showMore keep all their placeholders ({{count}}, {{done}}, {{failed}}, {{stopped}}, {{left}}); a script checked every new value's placeholder set against English.

Testing

  • bun test packages/locales/src/ → 48 pass / 0 fail, including the three bundled-catalog tests (every string validates against English, key set legal and sorted, every plural family complete)
  • bun run check:i18n → check-i18n: OK (no hardcoded UI text; catalog sorted and fully referenced; no render-time global translator)
  • bunx turbo run typecheck → 25/25
  • bunx biome check packages/locales/zh-CN.json → clean
  • bunx turbo run test --filter=@thinkrail/locales --filter=@thinkrail/web → 48 + 1976 pass / 0 fail
  • Not verified: e2e and a desktop smoke run, same as feat(locales): add a Simplified Chinese catalog #866 and feat(locales): complete the Simplified Chinese catalog #871

@oisano11

Copy link
Copy Markdown
Contributor Author

Fork-PR note, same as #866 / #871 / #882: the workflow is sitting at action_required, so nothing has run yet. Could a maintainer approve it?

A couple of things worth knowing before you read the diff:

Why the gap appeared. check:i18n validates en.json only — it checks the catalog is sorted and every key is referenced, but not that the other bundled catalogs cover it. So a missing translation is silent: the key falls back to English at render time and nothing goes red. That is how the catalog drifted 77 keys behind without anyone noticing. I did not change the gate in this PR; if you would rather the bundled catalogs were held to full coverage, that is a separate change and I am happy to write it.

How I picked the wording. The catalog already has 2525 strings, so the terminology was settled before I got here: provider 提供方, repo 仓库, plan (the subscription) 套餐, host/agent/spec/Skill left in English, and — rather than —— (which appears nowhere in the file). Address forms follow the existing split — 您 in the longer explanatory copy, 你 in short status lines.

Two strings that are not straight translations.

  • auth.login.promptBlankFor is spliced mid-sentence by apps/web/src/auth/loginOptions.ts:28 — that is why the English value deliberately begins with .. The Chinese begins with 。.
  • settings.appearance.custom.steps keeps its <0>dark.theme.json</0> marker; CustomThemesSettings.tsx renders it as the clickable example.

Both plural families carry _one and _other even though Intl.PluralRules("zh-CN") only resolves other, matching how the other bundled catalogs are written.

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved — ready to merge.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified mechanically: key sets are identical to en.json (2604 = 2604, nothing missing or extra), and every one of the 79 added keys preserves the English placeholders and ICU markers — including the mid-sentence auth.login.promptBlankFor (leading 。 + {{fallback}}) and the clickable <0>dark.theme.json</0> marker in settings.appearance.custom.steps. Both new plural families keep _one and _other with {{count}}, and the only catalog-wide placeholder gaps are pre-existing _one variants that zh-CN never resolves. Terminology matches the existing catalog. Approving.

The bundled zh-CN catalog fell 77 keys behind en.json as the interface
grew, and a missing key falls back to English silently — the i18n gate
only checks en.json. Translate the gaps across auth, common, panels,
settings and workbench, including both forms of the two plural families.

The Chinese catalog keeps both the _one and the _other form even though
zh only needs _other, matching how the other bundled catalogs are
written.
@oisano11
oisano (oisano11) force-pushed the translate-remaining-zh-cn branch from b26b10c to 0b13ac6 Compare October 30, 2026 01:22
@oisano11

Copy link
Copy Markdown
Contributor Author

Rebased onto df7cb6d2 and added one commit (0b13ac6d, +19) for the resources.* keys that #1004 introduced, so zh-CN.json now matches en.json key for key (2630). The first commit is unchanged apart from the rebase. Gates are green locally (details in the description). The fork workflow is at action_required again and needs approval to run.

@jetbrains-air jetbrains-air Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved — ready to merge.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants