phraser: move the fallbacks onto the deck (V-502)

This commit is contained in:
2026-08-04 01:26:52 +04:00
parent 3f2782f5b7
commit 1c9ddbbea2
2 changed files with 24 additions and 133 deletions
+1 -10
View File
@@ -13,16 +13,7 @@ import (
// fallbacks_ru_v1.json break Go tests, which is the coupling this file removed.
func isFallback(t *testing.T, key, sources, got string) bool {
t.Helper()
e, ok := DefaultFallbacks().file.Entries[key]
if !ok {
t.Fatalf("no fallback entry %q", key)
}
for _, v := range e.Variants {
if strings.ReplaceAll(v, "{sources}", sources) == got {
return true
}
}
return false
return DefaultFallbacks().deck().matches(key, map[string]string{"sources": sources}, got)
}
// A dead server must be distinguishable from bad phrasing. Both PhraseChat and