i18n(zh): complete Simplified Chinese translations and localize the previously hardcoded copy - #1571
Merged
Merged
Conversation
Two related halves, both verified 1:1 against values/ (key parity and placeholder parity): - Fill the ~350 string/plural gaps in ide-ui and agent-ui values-zh; vcs-ui had no zh file at all and gets one covering all 175 strings. Existing translations are left untouched. - The Explore screen (empty/sparse states) and the built-in UI actions (the More menu) kept their copy inline, so translations could never reach them: extract it into values/strings.xml (original English verbatim) with zh translations, following the existing key style. - Add UiActionLocalization.kt: the built-in actions are contributed through the plugin API (ide-ui-api) as plain strings, so — same override pattern as SettingsLocalization — the UI maps built-in action ids to resources at render time; third-party plugin actions fall through untouched. - Five helpers become @composable (defaultPublishSteps, emptyGhostNote, ghostSpec, sparseBadge, pitchHeadline) to call stringResource; no behavior changes.
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.
What
Two related halves, both around Simplified Chinese support:
1. Fill the gaps in
values-zh.ide-uiwas missing ~350 strings (en has 1458, zh had 1139),agent-uiwas missing 2, andvcs-uihad no zh file at all — now filled in. Existing translations are left untouched, and everything is verified 1:1 againstvalues/(key parity + placeholder parity via a script). Missing keys fall back to English anyway, but now nothing on screen has to.2. Extract the copy that was hardcoded in composables.
A bunch of UI text never went through the resource files at all, so translations could never reach it:
These now live in
values/strings.xml(original English verbatim) with zh translations, following the existing key style.The More-menu actions are a special case: they're contributed through the plugin API (
ide-ui-api) as plain strings, and third-party plugins have no access to Compose resources. So I followed the same override pattern asSettingsLocalization— a newUiActionLocalization.ktmaps built-in action ids to resources at render time and falls back to the plugin-supplied string for unknown ids, so third-party plugin actions keep working unchanged.To call
stringResource, five small helpers became@Composable(defaultPublishSteps,emptyGhostNote,ghostSpec,sparseBadge,pitchHeadline) — no behavior changes otherwise.Notes
app_namestays "CodeAssist" (brand name, not translated)Happy to adjust any wording — and if you'd rather split this into two PRs (pure translation fill vs. the extraction), say the word.