i18n: Simplified Chinese (zh-hans) UI translation

- The i18n module now selects a catalog by language code instead of testing for Japanese:
  `language(app)` returns the code, `lookup` is shared by every catalog, and the undo/redo
  and workspace / 3D-view titles are formatted per language.
- New SIMPLIFIED_CHINESE catalog: the same (command, English label) keys as JAPANESE, one
  entry per fixed menu row of the engine tree (618 rows).
- `general.language` gains 简体中文 (`zh-hans`). Match System maps a Simplified Chinese locale
  (zh, zh-CN, zh_CN.UTF-8, zh-Hans-CN, zh-SG) to it and a Traditional one (zh-TW, zh-HK,
  zh-Hant) to English, which has no catalog of its own yet.
- The macOS Services menu item is 服务 in Chinese.
- Tests: both catalogs must cover the same fixed TREE entries; `...`, brackets and spacing
  keep the English shape; label/undo/panel-title/submenu/native-menu behaviour in zh-hans
  with file and layer names kept verbatim; the locale mapping; the preference round-trips
  through prefs.json.
This commit is contained in:
FeiLiuEM
2026-10-09 00:42:28 +08:00
parent d60cb71e29
commit ed0a724c93
5 changed files with 806 additions and 44 deletions
+8 -1
View File
@@ -184,7 +184,14 @@ pub fn build(app: &EffectcraftApp) -> NativeMenu {
if role == Role::Hide && !services_added {
out.push(NativeNode::Predefined {
role: Role::Services,
label: if crate::i18n::japanese(app) { "サービス" } else { "Services" }.into(),
label: if crate::i18n::japanese(app) {
"サービス"
} else if crate::i18n::chinese(app) {
"服务"
} else {
"Services"
}
.into(),
command: String::new(),
});
out.push(NativeNode::Separator);