Skip to content

feat(mobile): follow system language with a manual language setting - #602

Merged
huichen merged 1 commit into
mainfrom
claude/mobile-language
Sep 13, 2026
Merged

huichen merged 1 commit into
mainfrom
claude/mobile-language

Conversation

@huichen

@huichen huichen commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

What

Mobile now follows the system language by default (Chinese when the primary system language is Chinese, English otherwise) and adds a manual override.

  • Language setting: 设置 → 语言 on the sessions screen, and the same control at the bottom of the pairing screen so it is reachable before pairing. Options: Follow system / 中文 / English.
  • Persistence: the choice is stored in AsyncStorage and restored before the first screen renders, so a manual override survives restarts.
  • System sync: with "Follow system" selected, the app re-reads the system locale on locale-change events and on every foreground resume (Android can change language without restarting the process). Manual overrides are untouched until "Follow system" is selected again.
  • Immediate effect: switching applies without a restart; string consumers outside React (notifications, update/prompt) share the same i18n instance, so they follow the change too.
  • Failure handling: if the preference cannot be saved, the selection is not committed, the previous language stays active, and the control reports the failure.

Notes

  • Non-Chinese system languages fall back to English, as requested (no other locales were added).
  • A Chinese-key-parity test guards locales.ts so a new string cannot ship in only one language.

Verification

  • npm run typecheck, npm run lint, npm test in mobile/ — 80 suites / 989 tests pass.
  • New tests cover: locale → language mapping (zh-Hans/zh-Hant/other/empty), restoring each stored preference, save failure retaining the previous language, switching language from each settings entry point, foreground re-sync without locale events, and manual override beating OS changes.
  • Not verified on a physical device; UI review of the new setting row is still pending.

@huichen
huichen enabled auto-merge (squash) September 13, 2026 15:59
@huichen
huichen merged commit 7ded570 into main Sep 13, 2026
12 checks passed
@huichen
huichen deleted the claude/mobile-language branch September 13, 2026 16:01
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.

1 participant