diff --git a/crates/ui-egui/src/canvas/zoom_field.rs b/crates/ui-egui/src/canvas/zoom_field.rs index d236041b53..48a26afac0 100644 --- a/crates/ui-egui/src/canvas/zoom_field.rs +++ b/crates/ui-egui/src/canvas/zoom_field.rs @@ -583,6 +583,10 @@ mod tests { #[test] fn menu_i_key_does_not_leak_dotless_text_into_zoom_in_any_ui_language() { for code in ["az", "tr", "en", "de"] { + // English runs in every build; the others need the craft-i18n catalogs. + if code != "en" && !crate::i18n::needs_catalogs() { + continue; + } let lang = crate::i18n::Lang::from_code(code).unwrap(); crate::i18n::with_language(lang, || { for text in ["I", "i", "İ", "ı"] { diff --git a/crates/ui-egui/src/dialogs/adjust_dialog/tests.rs b/crates/ui-egui/src/dialogs/adjust_dialog/tests.rs index 85d73e0398..e988130541 100644 --- a/crates/ui-egui/src/dialogs/adjust_dialog/tests.rs +++ b/crates/ui-egui/src/dialogs/adjust_dialog/tests.rs @@ -228,6 +228,10 @@ fn sample_params(kind: &str) -> Value { #[test] fn curves_dialog_fits_its_graph_and_controls() { for language in ["en", "ru"] { + // English runs in every build; Russian needs the craft-i18n catalogs. + if language != "en" && !crate::i18n::needs_catalogs() { + continue; + } let _language = crate::i18n::language_scope(crate::i18n::Lang::from_code(language).unwrap()); for theme in crate::theme::ThemeKind::ALL { for size in [egui::vec2(1280.0, 900.0), egui::vec2(900.0, 720.0)] { diff --git a/crates/ui-egui/src/menus/menu_keys/harness_tests.rs b/crates/ui-egui/src/menus/menu_keys/harness_tests.rs index 3e60bbe1d1..d23dafdae6 100644 --- a/crates/ui-egui/src/menus/menu_keys/harness_tests.rs +++ b/crates/ui-egui/src/menus/menu_keys/harness_tests.rs @@ -283,6 +283,9 @@ fn underlined_text_marks_the_mnemonic_once_and_keeps_the_prefix() { /// Access keys preserve visible spelling and underline only the locale-correct I pair. #[test] fn azerbaijani_and_turkish_mnemonics_keep_the_two_i_pairs_distinct() { + if !crate::i18n::needs_catalogs() { + return; + } for code in ["az", "tr"] { let lang = crate::i18n::Lang::from_code(code).unwrap(); crate::i18n::with_language(lang, || { diff --git a/crates/ui-egui/src/menus/tests.rs b/crates/ui-egui/src/menus/tests.rs index a4fe08cb83..f4d87b544f 100644 --- a/crates/ui-egui/src/menus/tests.rs +++ b/crates/ui-egui/src/menus/tests.rs @@ -303,9 +303,12 @@ fn help_search_finds_commands_by_any_word() { /// In another UI language both the translated and the English names match. #[test] fn help_search_matches_the_ui_language_and_english() { + if !crate::i18n::needs_catalogs() { + return; + } let app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default()); let items = menu_items(&app); - let Some(fr) = crate::i18n::Lang::from_code("fr") else { return }; + let fr = crate::i18n::Lang::from_code("fr").expect("fr registered"); let ids = |q: &str| search_items(&items, q, fr).iter().map(|i| i.id.clone()).collect::>(); assert!(!ids(&crate::i18n::tr(fr, "Layer").to_lowercase()).is_empty(), "French menu name"); assert!(ids("distort").contains(&"edit.transform.distort".to_string()), "English still matches"); diff --git a/crates/ui-egui/src/panels/layer_menu_ui/tests.rs b/crates/ui-egui/src/panels/layer_menu_ui/tests.rs index e46190e3c6..e650a2e717 100644 --- a/crates/ui-egui/src/panels/layer_menu_ui/tests.rs +++ b/crates/ui-egui/src/panels/layer_menu_ui/tests.rs @@ -56,7 +56,11 @@ fn mask_toggle_context_menu_follows_the_clicked_layer_and_existing_translations( use egui_kittest::{Harness, kittest::Queryable}; for language in ["en", "fr"] { - let lang = crate::i18n::Lang::from_pref(language); + // English runs in every build; French needs the craft-i18n catalogs. + if language != "en" && !crate::i18n::needs_catalogs() { + continue; + } + let lang = crate::i18n::Lang::from_code(language).expect("registered language"); let _language = crate::i18n::language_scope(lang); let mut s = photocraft_engine::Session::new(); s.execute("file.new", json!({"width": 10, "height": 10})).unwrap(); diff --git a/crates/ui-egui/src/profile_open_tests.rs b/crates/ui-egui/src/profile_open_tests.rs index 651a93b3aa..95f1beaa4e 100644 --- a/crates/ui-egui/src/profile_open_tests.rs +++ b/crates/ui-egui/src/profile_open_tests.rs @@ -146,6 +146,10 @@ fn the_prompt_is_translated_and_still_names_its_file() { let png = adobe_png(); let template = "The document “{name}” has an embedded color profile that does not match the current {mode} working space."; for code in ["en", "de", "fr", "ja"] { + // English runs in every build; the others need the craft-i18n catalogs. + if code != "en" && !crate::i18n::needs_catalogs() { + continue; + } let services = Services { import: Some(Box::new(|name, bytes, opts| { photocraft_io::import_with_options(name, bytes, opts).map(|r| (r.document, r.warnings)).map_err(|e| e.to_string())