From 742833bfa42fe591ee2d085b415a4154a42e5fbc Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 9 Oct 2026 00:15:20 -0400 Subject: [PATCH] i18n: rustfmt the language table (#309 follow-up) Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/prefs.rs | 8 +------- crates/ui-egui/src/i18n.rs | 16 +++------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/crates/engine/src/prefs.rs b/crates/engine/src/prefs.rs index 12b4e0e6..881724c0 100644 --- a/crates/engine/src/prefs.rs +++ b/crates/engine/src/prefs.rs @@ -23,13 +23,7 @@ pub const PREFS_VERSION: u32 = 2; pub const PREFS_FILE: &str = "prefs.json"; /// Settings ▸ General ▸ Language: (label, `general.language` value). -pub const LANGUAGES: &[(&str, &str)] = &[ - ("Match System", "system"), - ("English", "en"), - ("日本語", "ja"), - ("简体中文", "zh-hans"), - ("繁體中文", "zh-hant"), -]; +pub const LANGUAGES: &[(&str, &str)] = &[("Match System", "system"), ("English", "en"), ("日本語", "ja"), ("简体中文", "zh-hans"), ("繁體中文", "zh-hant")]; /// Settings ▸ Startup & Repair ▸ Window Graphics: (label, `startup.windowGraphics` value). pub const WINDOW_GRAPHICS: &[(&str, &str)] = &[("Automatic", "auto"), ("OpenGL (compatibility)", "gl")]; diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index d173c19b..3735df98 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -2052,11 +2052,7 @@ mod tests { let mut japanese_keys = BTreeSet::new(); let mut chinese_keys = BTreeSet::new(); let mut traditional_keys = BTreeSet::new(); - for (catalog, unique) in [ - (JAPANESE, &mut japanese_keys), - (SIMPLIFIED_CHINESE, &mut chinese_keys), - (TRADITIONAL_CHINESE, &mut traditional_keys), - ] { + for (catalog, unique) in [(JAPANESE, &mut japanese_keys), (SIMPLIFIED_CHINESE, &mut chinese_keys), (TRADITIONAL_CHINESE, &mut traditional_keys)] { for (command, en, translated) in catalog { let key = (command.to_string(), en.to_string()); assert!(actual.contains(&key), "stale translation: {key:?}"); @@ -2191,10 +2187,7 @@ mod tests { "图层: File" ); // The submenu titles that name the current workspace / view. - assert_eq!( - submenu(&app, "Assign Shortcut to Workspace", "Assign Shortcut to “Default” Workspace".into()), - "为工作区“Default”指定快捷键" - ); + assert_eq!(submenu(&app, "Assign Shortcut to Workspace", "Assign Shortcut to “Default” Workspace".into()), "为工作区“Default”指定快捷键"); assert_eq!(submenu(&app, "Assign Shortcut to 3D View", "Assign Shortcut to “Top”".into()), "为 3D 视图“Top”指定快捷键"); // The menu tree carries the same commands and shortcuts with the Chinese labels. let zh = crate::native_menu::build(&app); @@ -2234,10 +2227,7 @@ mod tests { "圖層: File" ); // The submenu titles that name the current workspace / view. - assert_eq!( - submenu(&app, "Assign Shortcut to Workspace", "Assign Shortcut to “Default” Workspace".into()), - "為工作區“Default”指定快速鍵" - ); + assert_eq!(submenu(&app, "Assign Shortcut to Workspace", "Assign Shortcut to “Default” Workspace".into()), "為工作區“Default”指定快速鍵"); assert_eq!(submenu(&app, "Assign Shortcut to 3D View", "Assign Shortcut to “Top”".into()), "為 3D 檢視“Top”指定快速鍵"); // The menu tree carries the same commands and shortcuts with the Traditional labels. let zh = crate::native_menu::build(&app);