Skip to content

feat(i18n): add Simplified-Chinese i18n framework and localize web & desktop UI - #10900

Draft
EclipticAxis wants to merge 5 commits into
pingdotgg:mainfrom
EclipticAxis:i18n-zh-CN
Draft

feat(i18n): add Simplified-Chinese i18n framework and localize web & desktop UI#10900
EclipticAxis wants to merge 5 commits into
pingdotgg:mainfrom
EclipticAxis:i18n-zh-CN

Conversation

@EclipticAxis

Copy link
Copy Markdown

What changed

Adds a lightweight, zero-dependency i18n framework and a Simplified-Chinese (zh-CN) localization of the web and desktop apps.

  • packages/shared: a small I18n message catalog (en / zh-CN) with typed keys, locale switching, param interpolation, and graceful fallback (active locale -> en -> raw key). Adds a ./i18n subpath export. Default locale is zh-CN (see note below).
  • apps/web: wires the common first-screen, sidebar, settings navigation/search, confirm dialogs, composer placeholders/status copy, draft hero, empty states, PR-list empty states, context-window meter, and branch toolbar through useI18n()/t(). Adds a useI18n React hook that re-renders components on locale change.
  • apps/desktop: localizes the native application menu, update / startup / WSL dialogs, splash banner, and context-menu copy via the shared i18n singleton.
  • docs/internals/i18n.md: documents conventions (key naming, scope, lookup/fallback rules, how to add locales).

Why

Provide internationalization support and a complete Simplified-Chinese UI as a foundation for upstream multi-language support. This is derived from the community fork EclipticAxis/t3code-zh-CN and re-adapted onto the current upstream component structure (sidebars, settings, and composer were refactored since the fork's base).

Impact

  • UI now renders user-facing copy through the catalog; with the default zh-CN locale the app shows Chinese, and switching i18n.setLocale("en") returns English copy.
  • Missing keys never throw: they fall back to English, then to the raw key.
  • No behavioral change for non-UI logic.

Notes / open questions for reviewers

  • Default locale is currently set to zh-CN (per the fork's intent). The project may prefer en as the default with zh-CN opt-in; happy to change based on your preference.
  • A dev-only EN / 中文 switcher is intentionally not included in this PR to keep scope focused; the setLocale + useI18n subscription path already supports it as a follow-up.
  • Mobile / marketing / docs were left out of this pass.

Validation

  • tsc --noEmit passes for packages/shared, apps/web, and apps/desktop.
  • en.ts and zh-CN.ts key sets are verified identical (167 keys each).
  • Unit tests were updated to assert via the catalog; full test suite execution depends on the runtime matching the repo's required Node version ^24.

1465586445-jpg and others added 5 commits September 9, 2026 05:38
Add zh-CN/en message keys for the newly-localized web surfaces: composer
placeholders & send states, PR-list empty states, context-window compact,
sidebar search, settings section/search labels, and the branch toolbar.
Route user-facing text in the sidebar, settings nav/search, confirm dialog,
composer placeholder & primary actions, context-window meter, draft hero,
no-active-thread and PR-list empty states, and the branch toolbar through
useI18n()/t(), replacing hardcoded English. Add a useI18n hook to subscribe
components to locale changes and drop the now-unused composerPlaceholder
module. Adapt affected tests to run under the English catalog.
Route the native application menu, update/startup/WSL error dialogs, splash,
and in-page context menu (Copy Link/Copy Image/No suggestions) through the
shared i18n singleton, and update the affected tests to assert via i18n.t().
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants