Repository navigation
feat(locales): translate the keys the Chinese catalog is missing - #989
oisano (oisano11) wants to merge 2 commits into
Conversation
|
Fork-PR note, same as #866 / #871 / #882: the workflow is sitting at A couple of things worth knowing before you read the diff: Why the gap appeared. How I picked the wording. The catalog already has 2525 strings, so the terminology was settled before I got here: provider 提供方, repo 仓库, Two strings that are not straight translations.
Both plural families carry |
Olga Lavrichenko (OLavrik)
left a comment
There was a problem hiding this comment.
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.
b26b10c to
0b13ac6
Compare
|
Rebased onto |
Summary
Closes the gap between
en.jsonand the bundledzh-CN.jsonon currentmain: 2630 keys in English, 2532 in Chinese. A missing key falls back to English silently, becausecheck:i18nvalidatesen.jsononly, 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,
+98lines.Changes
packages/locales/zh-CN.json: 2532 → 2630 keys, every keyen.jsondeclares.validateCatalogdrops nothing, so the coverage is real rather than nominal.resources.*keys from feat(resources): keep finished background work out of the dock and persist each chat's history across restarts #1004 (resources.dock.finished,resources.inspector.showMore,resources.state.interrupted, …), added after a rebase ontodf7cb6d2.panels.connectProvider.modelsAvailable_*,panels.welcome.connectedModels_*) get_oneand_other, following how the other bundled catalogs are written even thoughIntl.PluralRules("zh-CN")only resolvesother.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.promptBlankForis spliced mid-sentence byloginOptions.ts:28, which is why the English value deliberately starts with.; the Chinese starts with。to match.settings.appearance.custom.stepskeeps its<0>dark.theme.json</0>marker, whichCustomThemesSettings.tsxrenders as a clickable example.resources.inspector.foldLabelandresources.inspector.showMorekeep 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/25bunx biome check packages/locales/zh-CN.json→ cleanbunx turbo run test --filter=@thinkrail/locales --filter=@thinkrail/web→ 48 + 1976 pass / 0 fail