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.
This commit is contained in:
RickiNano committed 2026-11-21 08:24:29 +01:00
1 parent 42c853396d
commit bffe7f9ba2
1 file changed
+6 -1
+6 -1
View File
@@ -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();