Skip to content

i18n(settings): use typed ids for status messages and the general pane - #820

Open
Tettu0530 wants to merge 2 commits into
Kuddev:mainfrom
Tettu0530:i18n/settings-3-status
Open

Tettu0530 wants to merge 2 commits into
Kuddev:mainfrom
Tettu0530:i18n/settings-3-status

Conversation

@Tettu0530

Copy link
Copy Markdown
Contributor

Result / 用户结果

With a non-zh/en UI language such as Japanese, the status messages in Settings (saving, backup push and restore, SSH import, provider key results) and the remaining labels and tooltips of the general pane were still English, because they come from language.pick(zh, en). This PR moves them to typed catalog ids and adds the Japanese translations. English and Chinese output is unchanged.

This is the third settings localization PR, after #639 and #793.

Design / 设计边界

  • Same approach as i18n(settings): use typed ids for appearance, fonts, keymap and About #639 and i18n(settings): use typed ids for setting help and option labels #793: call sites in settings_pane/status.rs and gpui_shell/settings_pane.rs change from language.pick("…", "…") to language.text(crate::i18n::Message::…). Neither file has a pick call left.
  • 75 new ids live under settings.status.* and settings.pane.*. When both the English and the Chinese text already exist under an id, that id is reused instead (for example common.save, common.cancel, hosts.imported, hosts.processing).
  • Status texts that were built by concatenating several pick fragments around a value become one message with a named placeholder, so each language can order the sentence itself. There are 8 of these, for example settings.status.restored_from = "Restored from {name} (some settings apply after restart)" and settings.pane.imported_terminals = "Imported {count} terminals; they are ready to use". The English and Chinese results are the same strings as before.
  • The AI provider page is not touched. The rebuilt provider page on main already uses typed ids.
  • ProviderStatus::text gets three existing arms (ClaudeConfirmation, AppliedToClaude, ModelsFetched) reformatted by rustfmt. Their behavior is unchanged. rustfmt now formats the whole match, since no long pick literal blocks it anymore.
  • No persisted settings, status variants, runtime lookup or fallback behavior changes.

The Japanese text was drafted with AI assistance. It went through two adversarial review passes against the English, the Simplified Chinese and the rendering code, then a full native review by me (native Japanese, native-level Chinese), then a final pass with another model.

Evidence / 验证依据

  • Script check over the touched files: each removed pick(zh, en) maps to an id with the same English and Chinese text, so EN/ZH output is identical. For the 8 merged messages I checked by hand that the formatted English and Chinese match the old concatenation.
  • Local checks on this branch (base cf6bafb): debug build of pebrel with gpui-shell passed. Independent and application i18n contract suites: 24 passed, 1 ignored in each. Focused GPUI tests (i18n::, settings_pane, keymap, ssh_settings, os_icons): 98 passed, 2 ignored. cargo fmt --all -- --check: no formatting diffs. python scripts/check_architecture.py --base cf6bafb2: passed. git diff --check: clean.
  • Every catalog id this PR adds is referenced from code. No unused ids are left. Existing catalog values on main are unchanged.
  • Visual check: on Windows 11 25H2, I went through the settings pages in Japanese on this branch. The status messages and general pane labels are in Japanese.

Remaining settings PR

  1. SSH settings, including the generic SSH host icon roles. It is ready on my fork and will follow after this one.

Separately, I plan a catalog-only PR with the Japanese text for the ids added since #568.

Required Review / 必须确认

  • Read CONTRIBUTING.md, docs/architecture.md, docs/project-constraints.md, and docs/internationalization.md.
  • New UI text uses typed message IDs with matching placeholders; untranslated locales keep the English fallback.
  • Architecture check passed without changing budgets.
  • Test results and local limitations are listed above.
  • No governance files changed.

Move the settings status messages, the general settings pane and the AI
provider page to typed catalog ids with Japanese translations. Status
messages that concatenated fragments become single messages with named
placeholders, so translations can use natural word order. English and
Chinese output is unchanged.
@Tettu0530
Tettu0530 requested a review from Kuddev as a code owner October 30, 2026 13:57
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