From b9febf68c1466167a9b7a85cd93e2f09375d0f51 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 10 Oct 2026 02:13:04 -0400 Subject: [PATCH] i18n: a new English string doesn't fail the Ukrainian catalog test (#294) Untranslated strings fall back to English, as in every other language; only stale Ukrainian entries fail. Otherwise every PR adding UI text breaks the build until someone translates it. Co-authored-by: Claude Opus 5.5 --- crates/ui-egui/src/i18n.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/i18n.rs b/crates/ui-egui/src/i18n.rs index 04f1c888..6eee4c29 100644 --- a/crates/ui-egui/src/i18n.rs +++ b/crates/ui-egui/src/i18n.rs @@ -2878,7 +2878,10 @@ mod tests { keys.extend(TABLE.iter().map(|(key, _)| *key)); keys.extend(ar::TABLE.iter().map(|(key, _)| *key)); keys.extend(pt_br::TABLE.iter().map(|(key, _)| *key)); - assert_eq!(keys, catalog.keys().copied().collect()); + // A new English string falls back to English until it is translated, so only stale + // entries (keys no catalog knows any more) fail. + let stale: Vec<_> = catalog.keys().filter(|k| !keys.contains(*k)).collect(); + assert!(stale.is_empty(), "Ukrainian entries for unknown keys: {stale:?}"); let placeholders = |s: &str| s.split('{').skip(1).filter_map(|part| part.split_once('}').map(|(name, _)| name.to_owned())).collect::>(); for (key, translation) in uk::TABLE {