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 <[email protected]>
This commit is contained in:
Brandon ThomasandClaude Opus 5.5 authored and GitHub committed 2026-10-10 02:13:04 -04:00
1 parent e585f9495d
commit b9febf68c1
1 file changed
+4 -1
+4 -1
View File
@@ -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::<Vec<_>>();
for (key, translation) in uk::TABLE {