From adcb460a63552d5fd6d134b7d69adf8a1050b23b Mon Sep 17 00:00:00 2001 From: Vedran Dobos <19259909+vedran-dobos@users.noreply.github.com> Date: Mon, 19 Oct 2026 10:54:50 +0200 Subject: [PATCH] i18n: the test also checks Page Layout's Sheet Options labels (#1891) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From CodeRabbit's review of #1892: the fix also strips the prefix from "Sheet Options|View" (the Gridlines and Headings checkboxes), but the test only rendered File › Options. It now opens Page Layout in French and Serbian too and checks that the checkboxes read "Affichage" / "Prikaz", not "Options de la feuille|Affichage" / "Opcije lista|Prikaz". It fails with the old catalog values. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/tests/file_menu.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/tests/file_menu.rs b/crates/ui-egui/tests/file_menu.rs index d4aa13c29..6cce9cdba 100644 --- a/crates/ui-egui/tests/file_menu.rs +++ b/crates/ui-egui/tests/file_menu.rs @@ -134,9 +134,9 @@ fn file_options_opens_the_options_page_and_pages_are_reachable_by_command() { #[test] fn translated_options_headings_show_no_context_prefix() { - for (code, headings, prefixed) in [ - ("fr", ["Général", "Enregistrer"], ["Options|Général", "Options|Enregistrer"]), - ("sr", ["Opšte", "Sačuvaj"], ["Opcije|Opšte", "Opcije|Sačuvaj"]), + for (code, headings, prefixed, (view, view_prefixed)) in [ + ("fr", ["Général", "Enregistrer"], ["Options|Général", "Options|Enregistrer"], ("Affichage", "Options de la feuille|Affichage")), + ("sr", ["Opšte", "Sačuvaj"], ["Opcije|Opšte", "Opcije|Sačuvaj"], ("Prikaz", "Opcije lista|Prikaz")), ] { let mut h = harness(Services::default()); h.state_mut().run("app.language.set", serde_json::json!({"language": code})).unwrap(); @@ -149,6 +149,13 @@ fn translated_options_headings_show_no_context_prefix() { for label in prefixed { assert!(h.query_by_label(label).is_none(), "{code}: {label} shows its context"); } + // Page Layout › Sheet Options: the Gridlines and Headings "View" checkboxes had the same + // prefix. The View tab may share the word, so count at least the two checkboxes. + h.state_mut().run("ui.backstage", serde_json::json!({"page": "close"})).unwrap(); + h.state_mut().ui.ribbon_tab = "Page Layout".into(); + h.run_steps(3); + assert!(h.query_by_label(view_prefixed).is_none(), "{code}: {view_prefixed} shows its context"); + assert!(h.query_all_by_label(view).count() >= 2, "{code}: the Sheet Options checkboxes don't read {view}"); } }