Resolve runtime translation references

This commit is contained in:
Hmmbob committed 2026-07-24 21:13:07 +02:00
1 parent 82acc05d38
commit 5d86dbe7e8
3 files changed
+106 -88

No files matched your search

+20 -2
View File
@@ -72,8 +72,26 @@ def _all_descriptions():
yield from visit(value)
def test_source_and_english_translation_are_identical():
assert _load("strings.json") == _load("translations/en.json")
def test_source_and_english_translation_topology_and_placeholders_match():
source = _load("strings.json")
english = _load("translations/en.json")
assert _topology(source) == _topology(english)
english_strings = dict(_walk_strings(english))
for path, value in _walk_strings(source):
assert _placeholders(value) == _placeholders(english_strings[path]), path
def test_runtime_translation_catalogs_have_no_unresolved_references():
for language in ("en", "nl"):
unresolved = [
(path, value)
for path, value in _walk_strings(
_load(f"translations/{language}.json")
)
if "[%key:" in value
]
assert unresolved == []
def test_english_and_dutch_catalog_topology_and_placeholders_match():