From 883f34b490ab85724e026290f531ca7bc9d1a884 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 26 Nov 2026 15:43:07 -0800 Subject: [PATCH] Translate the Swatch Libraries footer button name --- crates/ui-egui/src/panels/library_panel/tests.rs | 15 +++++++++++++++ crates/ui-egui/src/panels/swatches.rs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/library_panel/tests.rs b/crates/ui-egui/src/panels/library_panel/tests.rs index 1844bb5f5f..68fc0cf0de 100644 --- a/crates/ui-egui/src/panels/library_panel/tests.rs +++ b/crates/ui-egui/src/panels/library_panel/tests.rs @@ -14,6 +14,21 @@ fn app() -> VectorcraftApp { app } +#[test] +fn the_swatch_libraries_footer_button_uses_the_interface_language() { + use craft::ui::testing::Fixture; + + for (locale, label) in [("en", "Swatch Libraries Menu"), ("de", "Menü „Farbfeldbibliotheken“"), ("ja", "スウォッチライブラリメニュー")] + { + let mut app = app(); + app.session.prefs.interface_language = locale.into(); + crate::i18n::set_current(app.ui_language()); + let mut fixture = Fixture::new(move |ui| crate::panels::swatches::show(&mut app, ui)); + fixture.settle(); + assert!(fixture.by_label(label).is_some(), "missing {locale} Swatch Libraries button name: {label}"); + } +} + /// A context whose frames report their accessibility tree, so rows are found by their names. pub(crate) fn context() -> egui::Context { let ctx = crate::testing::ui_context(); diff --git a/crates/ui-egui/src/panels/swatches.rs b/crates/ui-egui/src/panels/swatches.rs index e7209609e3..efd5ed9533 100644 --- a/crates/ui-egui/src/panels/swatches.rs +++ b/crates/ui-egui/src/panels/swatches.rs @@ -777,7 +777,7 @@ fn footer(app: &mut VectorcraftApp, ui: &mut Ui) { // Libraries, Show Swatch Kinds and the edit action sit at the start edge; Delete at the end edge, then New Swatch // and New Color Group before it. let actions = [ - FooterAction::new(icon("library"), SwatchLibraries::MENU).pressed(library_panel::any_open::(&app.ui)), + FooterAction::new(icon("library"), tl!(SwatchLibraries::MENU)).pressed(library_panel::any_open::(&app.ui)), FooterAction::new(icon("dc-swatch-kinds"), tl!("Show Swatch Kinds")).pressed(kind != Kind::All), edit, FooterAction::new(icon("trash-2"), tl!("Delete Swatch"))