feat(i18n): use English source strings with German translation

Wrap all user-visible strings for translation, ship a complete German catalogue, align the NetBox version range (4.4.0-4.7.x) with the README and add a test that keeps them in sync.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
MrBlakeandClaude Opus 5.5 committed 2026-10-26 21:28:37 +01:00
1 parent e6995630e9
commit f557e7d49d
33 files changed
+1564 -314

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
import ast
import re
from pathlib import Path
ROOT = Path(__file__).parents[1]
def plugin_versions():
tree = ast.parse((ROOT / "netbox_documentation" / "__init__.py").read_text())
config = next(node for node in tree.body if isinstance(node, ast.ClassDef))
values = {
target.id: node.value.value
for node in config.body if isinstance(node, ast.Assign) and isinstance(node.value, ast.Constant)
for target in node.targets if isinstance(target, ast.Name)
}
return values["min_version"], values["max_version"]
def test_readme_matches_plugin_version_range():
minimum, maximum = plugin_versions()
expected = f"`{minimum}` – `{'.'.join(maximum.split('.')[:2])}.x`"
readme = (ROOT / "README.md").read_text()
assert re.search(rf"\| \*\*NetBox\*\* \| {re.escape(expected)} \|", readme)
assert f"- NetBox {expected}" in readme