From e836d1e32ce89c0b45c1b1dbdfd9508a76d90891 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 02:09:25 -0800 Subject: [PATCH] Tests: History names a plain step from the menu item's row A step that applies no effect, such as Object > Path > Clean Up, takes its plain row in each language, else the menu item's row without the ellipsis. The test checks that fallback in every catalog again. --- crates/ui-egui/src/panels/history.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/panels/history.rs b/crates/ui-egui/src/panels/history.rs index b75b831d1c..619bd889f5 100644 --- a/crates/ui-egui/src/panels/history.rs +++ b/crates/ui-egui/src/panels/history.rs @@ -188,9 +188,15 @@ mod tests { assert_eq!(listed(&mut app)[rows.len() - 6..rows.len() - 4], ["Apply Body", "Apply {name}"]); } - /// A step name with no catalog row has no translation. + /// A step that applies no effect, named like a menu item (Object › Path › Clean Up…), takes its + /// plain row, else the menu item's row without the ellipsis; a name with no row has none. #[test] - fn unknown_steps_have_no_name() { + fn plain_steps_read_the_menu_row_and_unknown_steps_have_no_name() { + for lang in crate::i18n::Lang::all() { + let menu_row = crate::i18n::has(lang, "Clean Up…").then(|| crate::i18n::tr(lang, "Clean Up…").trim_end_matches('…').to_string()); + let plain_row = crate::i18n::has(lang, "Clean Up").then(|| crate::i18n::tr(lang, "Clean Up").to_string()); + assert_eq!(step_name(lang, "Clean Up"), plain_row.or(menu_row), "{}", lang.code()); + } let ja = crate::i18n::Lang::from_code("ja").expect("ja registered"); assert_eq!(step_name(ja, "No Such Step"), None); }