Repository navigation
Conversation
The window had no string catalog, so a system language or an explicit choice could not change what it says. Preferences now offers System, English and 简体中文. System follows a zh-Hans locale; Traditional Chinese stays English. The ribbon tabs, File menu, title bar, status bar and Preferences use that choice. Ribbon groups and the other dialogs stay in English. Co-authored-by: Cursor <cursoragent@cursor.com>
7991907 to
777b330
Compare
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the head of the diff: Simplified Chinese for the application shell, with the same sys-locale 0.3.2 lock hunk as deckcraft#555 and its siblings; stack them as said there. The Simplified Chinese catalogue needs a native check against PowerPoint's Simplified Chinese terms (the oracle), and the interface draws Chinese with the system's CJK font. The suite has other Chinese work (deckcraft#1096 maps Chinese font names to open fonts), and the language code must be clear about Simplified versus Traditional. I have not run it, and no exact-head CI result exists for this head. Nothing was run.
I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.
Status: waiting_author.
aiongg
left a comment
There was a problem hiding this comment.
AI-generated review (Opus). Not a maintainer decision.
Changes needed:
This adds a Simplified Chinese catalog for the application shell, an interface-language setting in Preferences and an app.language command. Tag mapping keeps Traditional Chinese out, and a saved unknown code falls back to System.
- The catalog is a hardcoded table in crates/ui-egui/src/i18n.rs:136. Other open changes add the same language-selection mechanism, either per language or through shared catalogs. Only one of these can be the base, and each language would then add only its strings.
- Cancel in Preferences restores dark mode and interface size but not the interface language. preferences_snapshot and restore_preferences (crates/ui-egui/src/dialogs.rs:150-172) do not save or restore app.ui.language.
- title.save, title.undo, title.redo, title.home and title.play (crates/ui-egui/src/i18n.rs:197-203) are never looked up, so the Quick Access Toolbar in the title bar stays English.
- The native menu bar's File menu (crates/ui-egui/src/menus.rs:164) and the status-bar 'Language' tooltip and ' (not checked)' suffix (crates/ui-egui/src/status.rs:30-32) are not translated.
- ROADMAP.md adds a second 'Last reviewed' status line below the existing one instead of updating it.
- nav.account uses 帐户; 账户 is the current standard form. The strings would benefit from a native-speaker review.
- This adds one new dependency, sys-locale, for native builds only. The web build leaves System on English.
Claims checked:
- verified: Preferences offers System, English and 简体中文, and the choice is saved in the UI state and settable with app.language (system, en, zh-Hans) (crates/ui-egui/src/dialogs.rs:2148-2158 shows the combo box over LanguageChoice::ALL. crates/ui-egui/src/lib.rs:274 adds UiState.language. crates/ui-egui/src/li…
- verified: System follows zh, zh-Hans, zh-CN or zh-SG; Traditional Chinese (zh-Hant, zh-TW, zh-HK, zh-MO) stays English (crates/ui-egui/src/i18n.rs:94-103: resolve_tag checks the Traditional prefixes first and returns En, then maps zh, zh-hans, zh-cn and zh-sg to ZhHans.)
- verified: On the web build, System stays English until the user picks a language (crates/ui-egui/src/i18n.rs:119-122: wasm32 gives tag None, and resolve maps None to Resolved::En (i18n.rs:59).)
- contradicted: The choice translates the ribbon tabs, File menu, title bar, status bar and Preferences (Ribbon tabs (crates/ui-egui/src/ribbon.rs:186-214), the backstage nav (crates/ui-egui/src/backstage.rs:428-442), the status bar (crates/ui-egui/src/status.rs:16-90) and Preferences (crates/ui-egui/src/dialogs.r…
- verified: 67 strings in all (crates/ui-egui/src/i18n.rs:136-204 has 67 CATALOG rows (12 nav, 16 pref, 11 status, 18 tab, 10 title); five title.* rows are unused.)
- verified: An unknown saved code falls back to System (crates/ui-egui/src/i18n.rs:71-76: Deserialize maps a failed parse to Self::System.)
- verified: Ribbon groups, other dialogs and command ids stay English (crates/ui-egui/src/ribbon.rs:202-205: the tab id
nameis still used for interaction and app.ui.tab, and onlyshownis painted. crates/ui-egui/src/dialogs.rs:83 translates only the preferences heading.)
Recommendation: update the pull request; it will be reviewed again.
Reviewed at 777b330.
|
Closing as superseded by #1530, which proposes Simplified Chinese through the current craft-i18n route. The replacement remains open for review. |
Summary
app.language(system,enorzh-Hans).zh,zh-Hans,zh-CNorzh-SGlocale. Traditional Chinese (zh-Hant,zh-TW,zh-HK,zh-MO) stays English, since that is Traditional Chinese (zh-Hant, Taiwan) interface translation #109. On the web build, System stays English until the user picks a language.Test plan
zh-CNresolves to 简体中文 whilezh-TWdoes not, and an unknown saved code falls back to System.app.languagezh-Hansrenames the File tab to 文件 and Preferences to 偏好设置, thatzh-TWis rejected, and thatenbrings File back.cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings, assets, layers and the wasm check pass.cargo test --workspacepasses, apart from three font tests that already fail here becausecraft-fontsis not installed:symbol_font_characters_draw_in_the_sym_font,korean_composes_in_the_notes_paneandcjk_text_in_the_interface_is_drawn_with_real_glyphs.