From bffe7f9ba2c1f197f520cc3b91b3cd16505e641d Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sat, 21 Nov 2026 08:24:29 +0100 Subject: [PATCH] First-launch language test: resolve all 14 system tags without an app, draw 3 The test built two whole apps for each of 14 system-tag cases (28 apps). Which language a tag picks is plain logic (`system::resolve` -> `lang_from_tag`), so every case now checks `Lang::from_pref("auto")` under its tags without a harness, including no tags and unsupported tags falling back to English. Drawing only differs by script, so one Latin (fr-CA), one CJK (ja-JP) and one Cyrillic (ru-RU) case still build the app, keep the stored preference at "auto" and find the translated File title in the menu. Part of #15376. Fixes #16039. --- crates/ui-egui/src/i18n/live_tests.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n/live_tests.rs b/crates/ui-egui/src/i18n/live_tests.rs index 45cd0cc03c4..d40c580558d 100644 --- a/crates/ui-egui/src/i18n/live_tests.rs +++ b/crates/ui-egui/src/i18n/live_tests.rs @@ -205,7 +205,8 @@ fn harness_with_services(services: Services) -> egui_kittest::Harness<'static, B } /// Auto draws the detected system language on first launch while keeping the Auto preference; no or -/// unsupported system languages draw English. +/// unsupported system languages draw English. Which language a tag picks is plain logic, checked for +/// every case; drawing differs only by script, so one app each draws Latin, CJK and Cyrillic. #[test] fn first_launch_renders_the_system_language_without_overwriting_auto() { if !needs_catalogs() { @@ -228,6 +229,10 @@ fn first_launch_renders_the_system_language_without_overwriting_auto() { (&["sw-KE", "is-IS"], "en"), ]; for (tags, code) in cases { + assert_eq!(system::with_system_tags(tags, || Lang::from_pref("auto")), lang(code), "{tags:?}"); + } + let drawn: [(&[&str], &str); 3] = [(&["fr-CA"], "fr"), (&["ja-JP"], "ja"), (&["ru-RU"], "ru")]; + for (tags, code) in drawn { system::with_system_tags(tags, || { with_language(Lang::EN, || { let h = harness();