feat: add German localization

Internationalize plugin navigation, forms, tables, model labels, detail templates, choices, and validation messages. Ship a compiled German Django message catalog and bump the plugin version to 1.10.0.
This commit is contained in:
2026-07-24 15:41:35 +02:00
parent 7ca670c717
commit 5887129546
20 changed files with 499 additions and 158 deletions
+7
View File
@@ -1,4 +1,5 @@
from django.core.exceptions import ValidationError
from django.utils.translation import gettext, override
from netbox_slm.forms import SoftwareLicenseForm
from tenancy.models import Tenant, TenantGroup
@@ -73,6 +74,12 @@ class ModelTestCase(SlmBaseTestCase):
any("tenant_group" in fieldset.items and "tenant" in fieldset.items for fieldset in form.fieldsets)
)
def test_german_translation(self):
with override("de"):
self.assertEqual("Softwarelizenz", gettext("Software License"))
self.assertEqual("Mandantengruppe", gettext("Tenant Group"))
self.assertEqual("Lizenzen", gettext("Licenses"))
def test_software_license_rejects_tenant_from_other_group(self):
other_group = TenantGroup.objects.create(name="other group", slug="other-group")
other_tenant = Tenant.objects.create(name="other tenant", slug="other-tenant", group=other_group)