Skip to content

UI: Simplified Chinese for the application shell - #538

Closed
NikitkaRa wants to merge 1 commit into
storytold:mainfrom
NikitkaRa:cursor/zh-hans-shell-7e0f
Closed

NikitkaRa wants to merge 1 commit into
storytold:mainfrom
NikitkaRa:cursor/zh-hans-shell-7e0f

Conversation

@NikitkaRa

Copy link
Copy Markdown
Contributor

Summary

  • Preferences offers System, English and 简体中文. The choice is saved in the UI state and can also be set with app.language (system, en or zh-Hans).
  • System follows a zh, zh-Hans, zh-CN or zh-SG locale. 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.
  • The choice translates the ribbon tabs, File menu, title bar, status bar and Preferences, 67 strings in all. Ribbon groups, the other dialogs and command ids stay English.

Test plan

  • Catalog tests check that ids are sorted, placeholder names match, zh-CN resolves to 简体中文 while zh-TW does not, and an unknown saved code falls back to System.
  • A UI test checks that app.language zh-Hans renames the File tab to 文件 and Preferences to 偏好设置, that zh-TW is rejected, and that en brings File back.
  • cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, assets, layers and the wasm check pass.
  • cargo test --workspace passes, apart from three font tests that already fail here because craft-fonts is not installed: symbol_font_characters_draw_in_the_sym_font, korean_composes_in_the_notes_pane and cjk_text_in_the_interface_is_drawn_with_real_glyphs.
  • On a Mac set to 简体中文, launch DeckCraft and check that the tabs and File menu come up in Chinese without opening Preferences.

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>

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 aiongg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 name is still used for interaction and app.ui.tab, and only shown is 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.

@FredApps

FredApps commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Closing as superseded by #1530, which proposes Simplified Chinese through the current craft-i18n route. The replacement remains open for review.

@FredApps FredApps closed this Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing feature The reference application has it and we do not, or only part of it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants