Repository navigation
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 / 设计边界
settings_pane/status.rsandgpui_shell/settings_pane.rschange fromlanguage.pick("…", "…")tolanguage.text(crate::i18n::Message::…). Neither file has apickcall left.settings.status.*andsettings.pane.*. When both the English and the Chinese text already exist under an id, that id is reused instead (for examplecommon.save,common.cancel,hosts.imported,hosts.processing).pickfragments around a value become one message with a named placeholder, so each language can order the sentence itself. There are 8 of these, for examplesettings.status.restored_from= "Restored from {name} (some settings apply after restart)" andsettings.pane.imported_terminals= "Imported {count} terminals; they are ready to use". The English and Chinese results are the same strings as before.ProviderStatus::textgets three existing arms (ClaudeConfirmation,AppliedToClaude,ModelsFetched) reformatted by rustfmt. Their behavior is unchanged. rustfmt now formats the whole match, since no longpickliteral blocks it anymore.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 / 验证依据
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.pebrelwithgpui-shellpassed. 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.Remaining settings PR
Separately, I plan a catalog-only PR with the Japanese text for the ids added since #568.
Required Review / 必须确认
CONTRIBUTING.md,docs/architecture.md,docs/project-constraints.md, anddocs/internationalization.md.