Files
MrBlakeandClaude Opus 5.5 f557e7d49d 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]>
2026-10-26 21:28:37 +01:00

25 lines
886 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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