Skip to content

feat(i18n): add opt-in Simplified Chinese settings and navigation - #16673

Closed
JesstLe wants to merge 1 commit into
pingdotgg:mainfrom
JesstLe:feat/opt-in-zh-cn-settings
Closed

JesstLe wants to merge 1 commit into
pingdotgg:mainfrom
JesstLe:feat/opt-in-zh-cn-settings

Conversation

@JesstLe

@JesstLe JesstLe commented Oct 7, 2026

Copy link
Copy Markdown

Problem

Current main has English-only interface copy and no persisted interface-language control. Chinese-speaking users cannot opt into a localized interface without a fork. This addresses one problem: a device-local, reversible Simplified Chinese interface preference with an initial translated settings surface.

Change

  • Add interfaceLanguage: en | zh-CN to client settings and the patch schema; existing settings decode to English. No automatic locale negotiation and no changed language default.
  • Share a dependency-free translation function and bundled Chinese catalog between web/desktop and mobile. Complete-message interpolation preserves platform shortcut names; missing copy falls back to its English source.
  • Web/desktop: language picker in Settings → General, reactive settings navigation/breadcrumbs, General settings copy and options, shared new-thread defaults, and Chinese settings-search aliases. Set html.lang above the router, including non-shell routes.
  • Mobile: device preference persistence/sanitization, language picker in Settings → Appearance, translated settings index. Preference writes use the existing serialized mobile store.
  • English can be selected again, and Restore device defaults resets the web/desktop preference to English. Conversation content, provider names, shell commands, project/environment names, and wire identifiers are not translated.
  • Add concise user guidance in the existing appearance guide. No new runtime dependency, no lockfile change, no server-side language preference.

This is incremental localization, not a whole-app translation. Advanced settings dialogs, other settings pages, chat/tool output, Electron-native menus, and the remaining mobile screens still use their existing copy.

Direction and related work

Related: Simplified Chinese discussion #6789, the maintainer's cross-client coverage comment, and the existing foundation proposal #16087. This implementation differs by retaining English as the default and avoiding new i18next/react-i18next dependencies. It is a community proposal, not a claim that the other contributor's work has merged or that this specific implementation has separate maintainer approval. If #16087 becomes the chosen foundation, this catalog/surface can be adapted to it rather than maintaining two systems.

Verification

Windows, Node 24.19.0, pnpm 11.10.0, current main base 740bda40c92e1ded65dd2b65ef7c583357b1d258.

  • Before changes: vp test run packages/contracts/src/settings.test.ts apps/web/src/components/settings/settingsSearch.test.ts apps/web/src/clientPersistenceStorage.test.ts → 227 passed, exit 0.
  • Focused final run:
vp test run packages/contracts/src/settings.test.ts \
  packages/client-runtime/src/i18n/index.test.ts \
  apps/web/src/components/settings/settingsSearch.test.ts \
  apps/web/src/hooks/useSettings.test.ts \
  apps/web/src/clientPersistenceStorage.test.ts \
  apps/web/src/i18n.test.tsx \
  apps/web/src/components/settings/SettingsPanels.restore.test.tsx \
  apps/mobile/src/persistence/mobile-preferences.language.test.ts \
  apps/web/src/components/settings/settingsLayout.test.tsx \
  apps/web/src/components/settings/scopedSettings.test.ts \
  apps/mobile/src/state/preferences.test.ts

→ 298 passed in 11 files, exit 0. Tests cover old-setting defaults, invalid language rejection, client-only patches, Chinese translation and English fallback, interpolation, reactive rendering and html.lang, reload/reverse switching, reset-to-English, Chinese search destinations, and actual mobile store save/reload/sanitization.

  • Scoped web and mobile tsc --noEmit → exit 0; targeted vp lint → exit 0 with existing warnings; formatter and git diff --check pass.
  • Web vp build → exit 0 (existing large-chunk warnings).
  • Real client in an independent Codex in-app browser, isolated .t3-zh-cn state: English → 简体中文 changes text immediately; reload retains 简体中文 and html.lang=zh-CN; switching back restores English and html.lang=en, including after reload. Searching 时间格式 finds the translated row and scrolls/focuses its actual setting. Light-mode screenshots below.
  • Rollback rehearsal in a separate checkout: reverse-applied this patch, recovered the original settings-file SHA256, clean checkout, 227 baseline tests passed. The feature checkout remains modified.

Desktop-native menus and a physical iOS/Android client were not exercised. The Electron renderer shares the verified web implementation; mobile evidence is typechecking and store tests, not native-device acceptance. No repo-wide checks were run.

Screenshots

English and Chinese before/after switching the language on the same build, not screenshots of an unmodified upstream build. Images are GitHub release assets on the fork, not committed to the source tree.

English 简体中文
English interface Chinese interface

Chinese settings search

Model: exact model identifier not exposed in this session. Harness: OpenAI Codex desktop.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Oct 7, 2026
@zhenweilai

Copy link
Copy Markdown

Thank you for this thoughtful work on Simplified Chinese settings and navigation! The reactive locale switching and Chinese settings search are fantastic additions. We are cheering for this and the shared i18n foundation to land upstream. Huge thanks for pushing this forward! 👍

@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Hi! We are cleaning up open PRs, and this one names a harness (Codex) but not which model version created it. If this change is really important, we recommend rebuilding the PR with a newer model and noting the model in the PR description.

@maria-rcks maria-rcks closed this Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ 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.

3 participants