From f557e7d49d2718acd0423557ff159d6f90a3277f Mon Sep 17 00:00:00 2001 From: Louis Date: Mon, 26 Oct 2026 21:28:37 +0100 Subject: [PATCH] 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 --- README.md | 7 +- netbox_documentation/__init__.py | 8 +- netbox_documentation/archive.py | 53 +- netbox_documentation/embedded_images.py | 11 +- netbox_documentation/forms.py | 100 +- netbox_documentation/importers.py | 22 +- .../locale/de/LC_MESSAGES/django.mo | Bin 0 -> 22558 bytes .../locale/de/LC_MESSAGES/django.po | 1142 +++++++++++++++++ netbox_documentation/models.py | 62 +- netbox_documentation/navigation.py | 21 +- netbox_documentation/tables.py | 9 +- .../netbox_documentation/document.html | 25 +- .../document_archive.html | 15 +- .../netbox_documentation/document_edit.html | 66 +- .../netbox_documentation/document_import.html | 11 +- .../netbox_documentation/document_print.html | 19 +- .../netbox_documentation/document_tree.html | 108 +- .../documentcategory.html | 15 +- .../documentcategory_tree.html | 11 +- .../excel_import_preview.html | 25 +- .../inc/category_tree_node.html | 5 +- .../inc/document_tree_file.html | 3 +- .../inc/document_tree_node.html | 3 +- .../inc/explorer_file_tile.html | 3 +- .../inc/explorer_folder_tile.html | 3 +- .../inc/explorer_pane.html | 3 +- .../inc/object_documents.html | 7 +- netbox_documentation/views.py | 77 +- pyproject.toml | 7 +- tests/conftest.py | 7 + tests/test_embedded_images.py | 4 +- tests/test_importers.py | 2 +- tests/test_metadata.py | 24 + 33 files changed, 1564 insertions(+), 314 deletions(-) create mode 100644 netbox_documentation/locale/de/LC_MESSAGES/django.mo create mode 100644 netbox_documentation/locale/de/LC_MESSAGES/django.po create mode 100644 tests/conftest.py create mode 100644 tests/test_metadata.py diff --git a/README.md b/README.md index 35f9906..41fbeec 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A wiki for operational documentation and how-tos, integrated into NetBox. |---|---| | **Plugin name** | `netbox_documentation` | | **Package** | `netbox-documentation` | -| **NetBox** | `>=4.0` | +| **NetBox** | `4.4.0` – `4.7.x` | | **Python** | `>=3.10` | | **Repository** | | @@ -50,7 +50,7 @@ Folder tree: ## Compatibility -- NetBox `>=4.0` +- NetBox `4.4.0` – `4.7.x` (tested with 4.7.3) - Python `>=3.10` Test the plugin against your exact NetBox minor version in a staging instance @@ -267,7 +267,8 @@ pytest ``` Full UI/API tests require NetBox in the same virtualenv. The pure import tests -are located in `netbox_documentation/tests/`. +are located in `tests/`. `tests/test_metadata.py` fails when the NetBox range +in this README diverges from `min_version`/`max_version` in the plugin config. ## Roadmap diff --git a/netbox_documentation/__init__.py b/netbox_documentation/__init__.py index f690167..ce12cd2 100644 --- a/netbox_documentation/__init__.py +++ b/netbox_documentation/__init__.py @@ -1,14 +1,16 @@ +from django.utils.translation import gettext_lazy as _ from netbox.plugins import PluginConfig class DocumentationConfig(PluginConfig): name = "netbox_documentation" - verbose_name = "NetBox Dokumentation" - description = "Wiki und Office-Dokumentation direkt in NetBox" + verbose_name = _("NetBox Documentation") + description = _("Wiki and office documentation directly in NetBox") version = "0.12.1" author = "LKE" base_url = "documentation" - min_version = "4.0.0" + min_version = "4.4.0" # netbox.object_actions + max_version = "4.7.99" django_apps = ["tinymce"] default_settings = { "allowed_object_types": [ diff --git a/netbox_documentation/archive.py b/netbox_documentation/archive.py index 7841dbd..8fe6b04 100644 --- a/netbox_documentation/archive.py +++ b/netbox_documentation/archive.py @@ -8,6 +8,7 @@ from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError from django.db import transaction from django.utils.text import slugify +from django.utils.translation import gettext as _ from tenancy.models import Tenant, TenantGroup from .models import Document, DocumentAssignment, DocumentAttachment, DocumentCategory @@ -113,23 +114,23 @@ def export_documents(documents): def _validate_archive(archive): infos = archive.infolist() if len(infos) > MAX_ENTRIES: - raise ArchiveFailure(f"Das Archiv enthält mehr als {MAX_ENTRIES} Dateien.") + raise ArchiveFailure(_("The archive contains more than %(count)s files.") % {"count": MAX_ENTRIES}) limit = settings.PLUGINS_CONFIG.get("netbox_documentation", {}).get("max_archive_size_mb", 250) * 1024 * 1024 if sum(info.file_size for info in infos) > limit: - raise ArchiveFailure("Die entpackte Gesamtgröße überschreitet das konfigurierte Limit.") + raise ArchiveFailure(_("The total extracted size exceeds the configured limit.")) for info in infos: path = PurePosixPath(info.filename) if path.is_absolute() or ".." in path.parts: - raise ArchiveFailure("Das Archiv enthält einen unsicheren Dateipfad.") + raise ArchiveFailure(_("The archive contains an unsafe file path.")) if info.compress_size and info.file_size / info.compress_size > 200: - raise ArchiveFailure("Das Archiv enthält eine verdächtig stark komprimierte Datei.") + raise ArchiveFailure(_("The archive contains a suspiciously highly compressed file.")) def _read_json(archive, name): try: return json.loads(archive.read(name).decode("utf-8")) except (KeyError, UnicodeDecodeError, json.JSONDecodeError) as exc: - raise ArchiveFailure("Das Archiv enthält kein gültiges manifest.json.") from exc + raise ArchiveFailure(_("The archive contains no valid manifest.json.")) from exc def _resolve_tenant_group(slug, context): @@ -147,9 +148,10 @@ def _resolve_tenant_group(slug, context): group = TenantGroup.objects.filter(slug=slug).first() if group is None: raise ArchiveFailure( - f"{context}: Die Mandantengruppe „{slug}“ existiert auf dieser Instanz nicht. " - "Bitte die Mandantengruppe vorher anlegen oder den Import mit einem angepassten " - "manifest.json wiederholen." + _( + "%(context)s: The tenant group “%(slug)s” does not exist on this instance. " + "Create the tenant group first or repeat the import with an adjusted manifest.json." + ) % {"context": context, "slug": slug} ) return group @@ -167,9 +169,10 @@ def _resolve_tenant(slug, context): tenant = Tenant.objects.filter(slug=slug).first() if tenant is None: raise ArchiveFailure( - f"{context}: Der Mandant „{slug}“ existiert auf dieser Instanz nicht. " - "Bitte den Mandanten vorher anlegen oder den Import mit einem angepassten " - "manifest.json wiederholen." + _( + "%(context)s: The tenant “%(slug)s” does not exist on this instance. " + "Create the tenant first or repeat the import with an adjusted manifest.json." + ) % {"context": context, "slug": slug} ) return tenant @@ -181,15 +184,15 @@ def _category_from_path(names, tenancy_path=None): name = str(name).strip()[:100] if not name: continue - slug = slugify(name)[:100] or "ordner" + slug = slugify(name)[:100] or "folder" tenancy = tenancy_path[index] if index < len(tenancy_path) and isinstance(tenancy_path[index], dict) else {} - context = f"Ordner „{name}“" + context = _("Folder “%(name)s”") % {"name": name} tenant_group = _resolve_tenant_group(tenancy.get("tenant_group"), context) tenant = _resolve_tenant(tenancy.get("tenant"), context) if tenant and tenant_group and tenant.group_id != tenant_group.pk: raise ArchiveFailure( - f"{context}: Der Mandant „{tenant.slug}“ gehört nicht zur " - f"Mandantengruppe „{tenant_group.slug}“ auf dieser Instanz." + _("%(context)s: The tenant “%(tenant)s” does not belong to the tenant group “%(group)s” on this instance.") + % {"context": context, "tenant": tenant.slug, "group": tenant_group.slug} ) category = DocumentCategory.objects.filter(parent=parent, slug=slug).first() if not category: @@ -226,24 +229,24 @@ def import_archive(upload, update_existing=False): try: archive = ZipFile(upload) except BadZipFile as exc: - raise ArchiveFailure("Die hochgeladene Datei ist kein gültiges ZIP-Archiv.") from exc + raise ArchiveFailure(_("The uploaded file is not a valid ZIP archive.")) from exc with archive: _validate_archive(archive) manifest = _read_json(archive, "manifest.json") if manifest.get("format") != ARCHIVE_FORMAT or manifest.get("version") != ARCHIVE_VERSION: - raise ArchiveFailure("Archivformat oder Version wird nicht unterstützt.") + raise ArchiveFailure(_("Archive format or version is not supported.")) records = manifest.get("documents") if not isinstance(records, list): - raise ArchiveFailure("Die Dokumentliste im Archiv ist ungültig.") + raise ArchiveFailure(_("The document list in the archive is invalid.")) allowed = set(settings.PLUGINS_CONFIG.get("netbox_documentation", {}).get("allowed_object_types", [])) created, updated, skipped_assignments = 0, 0, 0 for record in records: if not isinstance(record, dict) or not record.get("title") or not record.get("body_path"): - raise ArchiveFailure("Das Archiv enthält einen unvollständigen Dokumenteintrag.") + raise ArchiveFailure(_("The archive contains an incomplete document entry.")) try: body = archive.read(record["body_path"]).decode("utf-8") except (KeyError, UnicodeDecodeError) as exc: - raise ArchiveFailure("Ein Dokumentinhalt fehlt oder ist nicht UTF-8-kodiert.") from exc + raise ArchiveFailure(_("A document body is missing or not UTF-8 encoded.")) from exc source_slug = str(record.get("slug") or record["title"]) document = Document.objects.filter(slug=source_slug).first() if update_existing else None category = _category_from_path( @@ -260,13 +263,13 @@ def import_archive(upload, update_existing=False): document.body_format = record.get("body_format") if record.get("body_format") in {"html", "markdown"} else "html" document.is_published = bool(record.get("is_published", True)) document.category = category - context = f"Dokument „{document.title}“" + context = _("Document “%(title)s”") % {"title": document.title} document.tenant_group = _resolve_tenant_group(record.get("tenant_group"), context) document.tenant = _resolve_tenant(record.get("tenant"), context) if document.tenant and document.tenant_group and document.tenant.group_id != document.tenant_group_id: raise ArchiveFailure( - f"{context}: Der Mandant „{document.tenant.slug}“ gehört nicht zur " - f"Mandantengruppe „{document.tenant_group.slug}“ auf dieser Instanz." + _("%(context)s: The tenant “%(tenant)s” does not belong to the tenant group “%(group)s” on this instance.") + % {"context": context, "tenant": document.tenant.slug, "group": document.tenant_group.slug} ) _save_imported_object(document, context) for assignment in record.get("assignments") or []: @@ -291,12 +294,12 @@ def import_archive(upload, update_existing=False): try: content = archive.read(member) except KeyError as exc: - raise ArchiveFailure(f"Anhang {member} fehlt im Archiv.") from exc + raise ArchiveFailure(_("Attachment %(name)s is missing from the archive.") % {"name": member}) from exc from django.core.files.base import ContentFile original_name = Path(str(item.get("original_name") or "attachment")).name[:255] allowed_extensions = {".docx", ".xlsx", ".xlsm", ".pdf", ".md", ".txt", ".jpg", ".jpeg", ".png", ".gif", ".webp"} if Path(original_name).suffix.lower() not in allowed_extensions: - raise ArchiveFailure(f"Der Anhang {original_name} verwendet einen nicht erlaubten Dateityp.") + raise ArchiveFailure(_("The attachment %(name)s uses a file type that is not allowed.") % {"name": original_name}) existing = document.attachments.filter(original_name=original_name, size=len(content)).first() if existing: if item.get("source_url"): diff --git a/netbox_documentation/embedded_images.py b/netbox_documentation/embedded_images.py index a628d55..5d8c6c7 100644 --- a/netbox_documentation/embedded_images.py +++ b/netbox_documentation/embedded_images.py @@ -1,6 +1,7 @@ import base64 from io import BytesIO import re +from django.utils.translation import gettext as _ class EmbeddedImageError(ValueError): @@ -20,23 +21,23 @@ def _decode(match): try: content = base64.b64decode(payload, validate=True) except (ValueError, TypeError) as exc: - raise EmbeddedImageError("Ein eingefügtes Bild enthält ungültige Base64-Daten.") from exc + raise EmbeddedImageError(_("A pasted image contains invalid Base64 data.")) from exc try: from PIL import Image image = Image.open(BytesIO(content)) image.verify() except Exception as exc: - raise EmbeddedImageError("Ein eingefügter Inhalt ist keine gültige Bilddatei.") from exc + raise EmbeddedImageError(_("Pasted content is not a valid image file.")) from exc return match.group("mime").lower(), content def validate_embedded_images(html, max_total_bytes): total = 0 for match in DATA_IMAGE_RE.finditer(html or ""): - _, content = _decode(match) + _mime, content = _decode(match) total += len(content) if total > max_total_bytes: - raise EmbeddedImageError("Die eingefügten Bilder überschreiten die erlaubte Gesamtgröße.") + raise EmbeddedImageError(_("The pasted images exceed the allowed total size.")) def store_embedded_images(html, max_total_bytes, store): @@ -47,7 +48,7 @@ def store_embedded_images(html, max_total_bytes, store): mime, content = _decode(match) total += len(content) if total > max_total_bytes: - raise EmbeddedImageError("Die eingefügten Bilder überschreiten die erlaubte Gesamtgröße.") + raise EmbeddedImageError(_("The pasted images exceed the allowed total size.")) url = store(mime, content) return f'{match.group("prefix")}{url}{match.group("quote")}' diff --git a/netbox_documentation/forms.py b/netbox_documentation/forms.py index cb62452..7449c6c 100644 --- a/netbox_documentation/forms.py +++ b/netbox_documentation/forms.py @@ -3,7 +3,10 @@ from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.files.base import ContentFile from django.db.models import Q +from django.utils.functional import lazy from django.utils.html import format_html +from django.utils.safestring import SafeString +from django.utils.translation import gettext_lazy as _ from utilities.forms import get_field_value from utilities.forms.fields import ( ContentTypeChoiceField, DynamicModelChoiceField, DynamicModelMultipleChoiceField, SlugField, @@ -17,7 +20,7 @@ from .embedded_images import EmbeddedImageError, store_embedded_images, validate from .models import Document, DocumentAssignment, DocumentAttachment, DocumentCategory -def help_label(label, description): +def _help_label(label, description): return format_html( '{} ', @@ -25,6 +28,9 @@ def help_label(label, description): ) +help_label = lazy(_help_label, SafeString) # labels are built at import time, render in the request language + + def allowed_content_types(): labels = settings.PLUGINS_CONFIG.get("netbox_documentation", {}).get( "allowed_object_types", [] @@ -38,22 +44,22 @@ def allowed_content_types(): class DocumentForm(NetBoxModelForm): slug = SlugField(slug_source="title") - body = forms.CharField(required=False, label="Inhalt", widget=forms.Textarea(attrs={ + body = forms.CharField(required=False, label=_("Content"), widget=forms.Textarea(attrs={ "rows": 32, "class": "rich-text-editor", "data-rich-text-editor": "true" - }), help_text="Formatierter Text mit Tabellen, Farben, Schriftarten und Größen.") + }), help_text=_("Formatted text with tables, colours, fonts and sizes.")) body_format = forms.CharField(widget=forms.HiddenInput(), initial="html") - category = DynamicModelChoiceField(queryset=DocumentCategory.objects.all(), required=False, label="Ordner") + category = DynamicModelChoiceField(queryset=DocumentCategory.objects.all(), required=False, label=_("Folder")) tenant_group = DynamicModelChoiceField( - queryset=TenantGroup.objects.all(), required=False, selector=True, label="Mandantengruppe", + queryset=TenantGroup.objects.all(), required=False, selector=True, label=_("Tenant group"), ) tenant = DynamicModelChoiceField( - queryset=Tenant.objects.all(), required=False, selector=True, label="Mandant", + queryset=Tenant.objects.all(), required=False, selector=True, label=_("Tenant"), query_params={"group_id": "$tenant_group"}, ) fieldsets = ( - FieldSet("title", "slug", "category", "tenant_group", "tenant", "summary", "is_published", "tags", name="Dokumentation"), - FieldSet("body", "body_format", name="Inhalt"), + FieldSet("title", "slug", "category", "tenant_group", "tenant", "summary", "is_published", "tags", name=_("Document")), + FieldSet("body", "body_format", name=_("Content")), ) class Meta: @@ -83,7 +89,7 @@ class DocumentForm(NetBoxModelForm): cleaned = self.cleaned_data tenant, group = cleaned.get("tenant"), cleaned.get("tenant_group") if tenant and group and tenant.group_id != group.pk: - self.add_error("tenant", "Der Mandant gehört nicht zur ausgewählten Mandantengruppe.") + self.add_error("tenant", _("The tenant does not belong to the selected tenant group.")) return cleaned def save(self, commit=True): @@ -98,7 +104,7 @@ class DocumentForm(NetBoxModelForm): nonlocal counter counter += 1 extension = {"image/jpeg": "jpg", "image/png": "png", "image/gif": "gif", "image/webp": "webp"}[mime] - name = f"editor-bild-{document.pk}-{counter}.{extension}" + name = f"editor-image-{document.pk}-{counter}.{extension}" attachment = DocumentAttachment( document=document, original_name=name, content_type=mime, size=len(content), ) @@ -112,12 +118,12 @@ class DocumentForm(NetBoxModelForm): class AssignmentForm(NetBoxModelForm): - assigned_object_type = ContentTypeChoiceField(queryset=ContentType.objects.none(), label="Objekttyp", widget=HTMXSelect()) + assigned_object_type = ContentTypeChoiceField(queryset=ContentType.objects.none(), label=_("Object type"), widget=HTMXSelect()) assigned_object = DynamicModelChoiceField( - queryset=Device.objects.none(), label="NetBox-Objekt", required=True, disabled=True, selector=True + queryset=Device.objects.none(), label=_("NetBox object"), required=True, disabled=True, selector=True ) - fieldsets = (FieldSet("document", "assigned_object_type", "assigned_object", "note", "tags", name="Dokumentation zuordnen"),) + fieldsets = (FieldSet("document", "assigned_object_type", "assigned_object", "note", "tags", name=_("Assign document")),) class Meta: model = DocumentAssignment @@ -149,16 +155,16 @@ class AssignmentForm(NetBoxModelForm): class DocumentCategoryForm(NetBoxModelForm): slug = SlugField(slug_source="name") - parent = DynamicModelChoiceField(queryset=DocumentCategory.objects.all(), required=False, label="Übergeordneter Ordner") + parent = DynamicModelChoiceField(queryset=DocumentCategory.objects.all(), required=False, label=_("Parent folder")) tenant_group = DynamicModelChoiceField( - queryset=TenantGroup.objects.all(), required=False, selector=True, label="Mandantengruppe", + queryset=TenantGroup.objects.all(), required=False, selector=True, label=_("Tenant group"), ) tenant = DynamicModelChoiceField( - queryset=Tenant.objects.all(), required=False, selector=True, label="Mandant", + queryset=Tenant.objects.all(), required=False, selector=True, label=_("Tenant"), query_params={"group_id": "$tenant_group"}, ) - fieldsets = (FieldSet("name", "slug", "parent", "tenant_group", "tenant", "description", "tags", name="Ordner"),) + fieldsets = (FieldSet("name", "slug", "parent", "tenant_group", "tenant", "description", "tags", name=_("Folder")),) class Meta: model = DocumentCategory @@ -174,38 +180,38 @@ class DocumentCategoryForm(NetBoxModelForm): cleaned = self.cleaned_data tenant, group = cleaned.get("tenant"), cleaned.get("tenant_group") if tenant and group and tenant.group_id != group.pk: - self.add_error("tenant", "Der Mandant gehört nicht zur ausgewählten Mandantengruppe.") + self.add_error("tenant", _("The tenant does not belong to the selected tenant group.")) return cleaned class ImportForm(forms.Form): - file = forms.FileField(label="Word-, Excel- oder PDF-Datei") + file = forms.FileField(label=_("Word, Excel or PDF file")) title = forms.CharField(max_length=200, required=False, label=help_label( - "Titel", "Leer lassen, um den Dateinamen als Titel zu verwenden. Beim Mehrblattimport werden die Blattnamen verwendet." + _("Title"), _("Leave empty to use the file name as title. Multi-sheet imports use the sheet names.") )) append = forms.BooleanField(required=False, initial=False, label=help_label( - "An bestehende Dokumentation anhängen", "Fügt den importierten Inhalt am Ende einer vorhandenen Dokumentation an." + _("Append to existing document"), _("Adds the imported content to the end of an existing document.") )) document = forms.ModelChoiceField(queryset=Document.objects.all(), required=False, label=help_label( - "Bestehende Dokumentation", "Zieldokumentation für die Funktion Anhängen." + _("Existing document"), _("Target document for appending.") )) excel_sheets_as_documents = forms.BooleanField( required=False, label=help_label( - "Excel mit mehreren Arbeitsblättern – je Blatt eine Dokumentation", - "Erstellt aus jedem nicht leeren Excel-Arbeitsblatt eine eigene Dokumentation im gewählten Zielordner.", + _("Excel with multiple worksheets – one document per sheet"), + _("Creates a separate document in the selected target folder from every non-empty Excel worksheet."), ), ) flatten_excel_tables = forms.BooleanField( required=False, label=help_label( - "Excel-Tabellen glätten", - "Übernimmt normale Zellen ohne Tabelle als dokumentartigen Text. Nur in Excel ausdrücklich über Einfügen → Tabelle definierte Bereiche bleiben Tabellen.", + _("Flatten Excel tables"), + _("Imports plain cells outside tables as document-style text. Only ranges explicitly defined in Excel via Insert → Table remain tables."), ), ) category = forms.ModelChoiceField( queryset=DocumentCategory.objects.none(), required=False, - label=help_label("Zielordner / Kategorie", "Für den Excel-Mehrblattimport verpflichtend."), + label=help_label(_("Target folder / category"), _("Required for the Excel multi-sheet import.")), ) def __init__(self, *args, user=None, **kwargs): @@ -217,30 +223,30 @@ class ImportForm(forms.Form): def clean(self): data = super().clean() if data.get("append") and not data.get("document"): - self.add_error("document", "Zum Anhängen muss eine Dokumentation gewählt werden.") + self.add_error("document", _("Select a document to append to.")) upload = data.get("file") if data.get("excel_sheets_as_documents"): if upload and not upload.name.lower().endswith((".xlsx", ".xlsm")): - self.add_error("file", "Der Mehrblattimport benötigt eine XLSX- oder XLSM-Datei.") + self.add_error("file", _("The multi-sheet import requires an XLSX or XLSM file.")) if not data.get("category"): - self.add_error("category", "Bitte einen Zielordner für die erzeugten Dokumentationen auswählen.") + self.add_error("category", _("Select a target folder for the generated documents.")) if data.get("append"): - self.add_error("append", "Mehrblattimport und Anhängen können nicht kombiniert werden.") + self.add_error("append", _("Multi-sheet import and appending cannot be combined.")) limit = settings.PLUGINS_CONFIG.get("netbox_documentation", {}).get("max_import_size_mb", 25) if upload and upload.size > limit * 1024 * 1024: - self.add_error("file", f"Die Datei ist größer als {limit} MB.") + self.add_error("file", _("The file is larger than %(limit)s MB.") % {"limit": limit}) return data class ArchiveExportForm(forms.Form): categories = DynamicModelMultipleChoiceField( queryset=DocumentCategory.objects.all(), selector=True, - label="Ordner und Kategorien", - help_text="Einen oder mehrere Ordner suchen und hinzufügen.", + label=_("Folders and categories"), + help_text=_("Search for and add one or more folders."), ) include_subfolders = forms.BooleanField( - required=False, initial=True, label="Unterordner einbeziehen", - help_text="Exportiert Dokumentationen aus allen untergeordneten Ordnern.", + required=False, initial=True, label=_("Include subfolders"), + help_text=_("Exports documents from all subfolders."), ) def __init__(self, *args, user=None, **kwargs): @@ -252,38 +258,38 @@ class ArchiveExportForm(forms.Form): class ArchiveImportForm(forms.Form): - archive = forms.FileField(label="ZIP-Archiv") + archive = forms.FileField(label=_("ZIP archive")) update_existing = forms.BooleanField( required=False, initial=False, - label="Bestehende Dokumentationen mit gleicher Kennung aktualisieren", - help_text="Ohne diese Option werden bei Namenskonflikten neue Dokumentationen mit einer fortlaufenden Kennung angelegt.", + label=_("Update existing documents with the same slug"), + help_text=_("Without this option, name conflicts create new documents with a numbered slug."), ) def clean_archive(self): upload = self.cleaned_data["archive"] if not upload.name.lower().endswith(".zip"): - raise forms.ValidationError("Bitte ein vom Plugin erzeugtes ZIP-Archiv auswählen.") + raise forms.ValidationError(_("Select a ZIP archive created by this plugin.")) limit = settings.PLUGINS_CONFIG.get("netbox_documentation", {}).get("max_archive_size_mb", 250) if upload.size > limit * 1024 * 1024: - raise forms.ValidationError(f"Das Archiv ist größer als {limit} MB.") + raise forms.ValidationError(_("The archive is larger than %(limit)s MB.") % {"limit": limit}) return upload class ExcelSheetSelectionForm(forms.Form): include = forms.BooleanField( - required=False, initial=True, label="Importieren", + required=False, initial=True, label=_("Import"), widget=forms.CheckboxInput(attrs={"class": "form-check-input"}), ) index = forms.IntegerField(widget=forms.HiddenInput()) title = forms.CharField( - max_length=200, required=False, label="Dokumenttitel", + max_length=200, required=False, label=_("Document title"), widget=forms.TextInput(attrs={"class": "form-control"}), ) def clean(self): data = super().clean() if data.get("include") and not (data.get("title") or "").strip(): - self.add_error("title", "Für ein ausgewähltes Arbeitsblatt ist ein Titel erforderlich.") + self.add_error("title", _("A selected worksheet requires a title.")) return data @@ -294,13 +300,13 @@ class BaseExcelSheetSelectionFormSet(forms.BaseFormSet): return selected = [form.cleaned_data for form in self.forms if form.cleaned_data.get("include")] if not selected: - raise forms.ValidationError("Bitte mindestens ein Arbeitsblatt auswählen.") + raise forms.ValidationError(_("Select at least one worksheet.")) indices = [item["index"] for item in selected] if len(indices) != len(set(indices)): - raise forms.ValidationError("Die Arbeitsblattauswahl ist ungültig.") + raise forms.ValidationError(_("The worksheet selection is invalid.")) titles = [item["title"].strip().casefold() for item in selected] if len(titles) != len(set(titles)): - raise forms.ValidationError("Ausgewählte Arbeitsblätter dürfen nicht denselben Dokumenttitel haben.") + raise forms.ValidationError(_("Selected worksheets must not have the same document title.")) ExcelSheetSelectionFormSet = forms.formset_factory( diff --git a/netbox_documentation/importers.py b/netbox_documentation/importers.py index dd0cc50..4972025 100644 --- a/netbox_documentation/importers.py +++ b/netbox_documentation/importers.py @@ -4,6 +4,8 @@ from pathlib import Path from html import escape import re +from django.utils.translation import gettext as _ + class ImportFailure(ValueError): pass @@ -46,8 +48,8 @@ def import_document(upload, flatten_excel=False) -> ImportResult: if suffix in {".md", ".txt"}: return ImportResult(content.decode("utf-8-sig")) if suffix in {".doc", ".xls"}: - raise ImportFailure("Alte .doc/.xls-Dateien bitte zuerst als .docx/.xlsx speichern.") - raise ImportFailure("Unterstützt werden DOCX, XLSX, XLSM, PDF, Markdown und Text.") + raise ImportFailure(_("Please save legacy .doc/.xls files as .docx/.xlsx first.")) + raise ImportFailure(_("Supported formats are DOCX, XLSX, XLSM, PDF, Markdown and text.")) def _docx(content): @@ -95,7 +97,7 @@ def _xlsx(content, flatten=False): rendered = _render_flattened_worksheet(sheet, workbook) if flatten else _render_excel_worksheet_html(sheet, workbook) sections.append(f"

{escape(sheet.title)}

\n{rendered}") if not sections: - raise ImportFailure("Die Arbeitsmappe enthält keine Daten.") + raise ImportFailure(_("The workbook contains no data.")) return ImportResult("\n\n".join(sections), body_format="html") @@ -109,7 +111,7 @@ def import_excel_sheets( suffix = Path(upload.name).suffix.lower() if suffix not in {".xlsx", ".xlsm"}: - raise ImportFailure("Der Mehrblattimport unterstützt XLSX- und XLSM-Dateien.") + raise ImportFailure(_("The multi-sheet import supports XLSX and XLSM files.")) upload.seek(0) workbook = load_workbook(upload, read_only=False, data_only=True) results = [] @@ -156,7 +158,7 @@ def import_excel_sheets( workbook.close() upload.seek(0) if not results: - raise ImportFailure("Die Arbeitsmappe enthält keine Daten oder unterstützten Bilder.") + raise ImportFailure(_("The workbook contains no data or supported images.")) return results @@ -348,7 +350,7 @@ def _render_excel_worksheet_html(sheet, workbook, max_rows=None, bounds=None): output.append("") output.append("") if max_rows and last_row > start_row + max_rows - 1: - output.append(f"

Vorschau auf {max_rows} Zeilen begrenzt.

") + output.append("

%s

" % escape(_("Preview limited to %(rows)s rows.") % {"rows": max_rows})) return "".join(output) @@ -398,7 +400,7 @@ def _render_flattened_worksheet(sheet, workbook, max_rows=None): bounds=(min_col, min_row, max_col, min(max_row, rendered_max_row)), )) if max_rows and sheet.max_row > max_rows: - blocks.append(f"

Vorschau auf {max_rows} von {sheet.max_row} Zeilen begrenzt.

") + blocks.append("

%s

" % escape(_("Preview limited to %(rows)s of %(total)s rows.") % {"rows": max_rows, "total": sheet.max_row})) return "\n".join(blocks) or "

Keine Inhalte

" @@ -410,7 +412,7 @@ def _pdf(content): text = (page.extract_text() or "").strip() if text: text = re.sub(r"[ \t]+\n", "\n", text) - pages.append(f"## Seite {number}\n\n{text}") + pages.append("## %s\n\n%s" % (_("Page %(number)s") % {"number": number}, text)) if not pages: - raise ImportFailure("Das PDF enthält keinen extrahierbaren Text. Für Scans ist OCR erforderlich.") - return ImportResult("\n\n".join(pages), ["PDF-Layout und Bilder können nicht vollständig übernommen werden."]) + raise ImportFailure(_("The PDF contains no extractable text. Scanned documents require OCR.")) + return ImportResult("\n\n".join(pages), [_("PDF layout and images cannot be imported completely.")]) diff --git a/netbox_documentation/locale/de/LC_MESSAGES/django.mo b/netbox_documentation/locale/de/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..3bdcd7788dbb8e207c44bf8573e541fcf919c0ec GIT binary patch literal 22558 zcmche3z%h9b>|P#AhbLsAc(@@(QN~LtD8n1cGF08S9jC)lkVo##?f2%p8KHgJ-0mP z+^((yltF_})BqA62qqF9YNDeFF^Gd&3{1x8I3^=e(NQv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){8+z~quofV0{kmse>6!(d}%GV&2vc6k1;4CeUI(#x`xq~}4|p~a_W zuFnZ*vk*n(&lb3d&vJ>IIH|iH!~fZ;&%GOy3oPtl<8y zR@*wuQX8h?u;?*8R!lo6A+93QMt9|qnZ@timaLmF&Ujk5ro}&UmFVh;qJwJ2fDj6P z%Z<`FwL#0f?cl^M|Bob5!H0V z$@#r-6Ar|_!)D2h54s$KBVsQLMtxvvaQR2tWrtnp(2e!rQTMtqZc_GCCfH zZaUQySlBH;JagM*>OFG*rkD>*V>)9TehP-@TD%Pm*!+8u1J~twUZb*!DsJxtEeFwD z{|~4=j4DibSFP%y(8qTv2s`T_y^6d+tQ6K@e3_ z@wzj|!q&DhYU%!v8|d)$p?pfqhzD_OP`*HPr~S9=TB|1yELPw}1&Vt_T$a#1qQVky PMiY2%GyD%Z-1mP4_Gog2 literal 0 HcmV?d00001 diff --git a/netbox_documentation/locale/de/LC_MESSAGES/django.po b/netbox_documentation/locale/de/LC_MESSAGES/django.po new file mode 100644 index 0000000..37813a9 --- /dev/null +++ b/netbox_documentation/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,1142 @@ +# German translation of netbox-documentation. +# +msgid "" +msgstr "" +"Project-Id-Version: netbox-documentation\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-10-26 20:23+0000\n" +"PO-Revision-Date: 2026-10-26 20:30+0000\n" +"Last-Translator: \n" +"Language-Team: German\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: __init__.py:7 +msgid "NetBox Documentation" +msgstr "NetBox Dokumentation" + +#: __init__.py:8 +msgid "Wiki and office documentation directly in NetBox" +msgstr "Wiki und Office-Dokumentation direkt in NetBox" + +#: archive.py:117 +#, python-format +msgid "The archive contains more than %(count)s files." +msgstr "Das Archiv enthält mehr als %(count)s Dateien." + +#: archive.py:120 +msgid "The total extracted size exceeds the configured limit." +msgstr "Die entpackte Gesamtgröße überschreitet das konfigurierte Limit." + +#: archive.py:124 +msgid "The archive contains an unsafe file path." +msgstr "Das Archiv enthält einen unsicheren Dateipfad." + +#: archive.py:126 +msgid "The archive contains a suspiciously highly compressed file." +msgstr "Das Archiv enthält eine verdächtig stark komprimierte Datei." + +#: archive.py:133 +msgid "The archive contains no valid manifest.json." +msgstr "Das Archiv enthält kein gültiges manifest.json." + +#: archive.py:152 +#, python-format +msgid "" +"%(context)s: The tenant group “%(slug)s” does not exist on this instance. " +"Create the tenant group first or repeat the import with an adjusted " +"manifest.json." +msgstr "%(context)s: Die Mandantengruppe „%(slug)s“ existiert auf dieser Instanz nicht. Bitte die Mandantengruppe vorher anlegen oder den Import mit einem angepassten manifest.json wiederholen." + +#: archive.py:173 +#, python-format +msgid "" +"%(context)s: The tenant “%(slug)s” does not exist on this instance. Create " +"the tenant first or repeat the import with an adjusted manifest.json." +msgstr "%(context)s: Der Mandant „%(slug)s“ existiert auf dieser Instanz nicht. Bitte den Mandanten vorher anlegen oder den Import mit einem angepassten manifest.json wiederholen." + +#: archive.py:189 +#, python-format +msgid "Folder “%(name)s”" +msgstr "Ordner „%(name)s“" + +#: archive.py:194 archive.py:271 +#, python-format +msgid "" +"%(context)s: The tenant “%(tenant)s” does not belong to the tenant group " +"“%(group)s” on this instance." +msgstr "%(context)s: Der Mandant „%(tenant)s“ gehört auf dieser Instanz nicht zur Mandantengruppe „%(group)s“." + +#: archive.py:232 +msgid "The uploaded file is not a valid ZIP archive." +msgstr "Die hochgeladene Datei ist kein gültiges ZIP-Archiv." + +#: archive.py:237 +msgid "Archive format or version is not supported." +msgstr "Archivformat oder Version wird nicht unterstützt." + +#: archive.py:240 +msgid "The document list in the archive is invalid." +msgstr "Die Dokumentliste im Archiv ist ungültig." + +#: archive.py:245 +msgid "The archive contains an incomplete document entry." +msgstr "Das Archiv enthält einen unvollständigen Dokumenteintrag." + +#: archive.py:249 +msgid "A document body is missing or not UTF-8 encoded." +msgstr "Ein Dokumentinhalt fehlt oder ist nicht UTF-8-kodiert." + +#: archive.py:266 +#, python-format +msgid "Document “%(title)s”" +msgstr "Dokument „%(title)s“" + +#: archive.py:297 +#, python-format +msgid "Attachment %(name)s is missing from the archive." +msgstr "Anhang %(name)s fehlt im Archiv." + +#: archive.py:302 +#, python-format +msgid "The attachment %(name)s uses a file type that is not allowed." +msgstr "Der Anhang %(name)s verwendet einen nicht erlaubten Dateityp." + +#: embedded_images.py:24 +msgid "A pasted image contains invalid Base64 data." +msgstr "Ein eingefügtes Bild enthält ungültige Base64-Daten." + +#: embedded_images.py:30 +msgid "Pasted content is not a valid image file." +msgstr "Ein eingefügter Inhalt ist keine gültige Bilddatei." + +#: embedded_images.py:40 embedded_images.py:51 +msgid "The pasted images exceed the allowed total size." +msgstr "Die eingefügten Bilder überschreiten die erlaubte Gesamtgröße." + +#: forms.py:47 forms.py:62 +msgid "Content" +msgstr "Inhalt" + +#: forms.py:49 +msgid "Formatted text with tables, colours, fonts and sizes." +msgstr "Formatierter Text mit Tabellen, Farben, Schriftarten und Größen." + +#: forms.py:51 forms.py:167 tables.py:18 +#: templates/netbox_documentation/document.html:132 +#: templates/netbox_documentation/document_print.html:70 +msgid "Folder" +msgstr "Ordner" + +#: forms.py:53 forms.py:160 +msgid "Tenant group" +msgstr "Mandantengruppe" + +#: forms.py:56 forms.py:163 +msgid "Tenant" +msgstr "Mandant" + +#: forms.py:61 +msgid "Document" +msgstr "Dokumentation" + +#: forms.py:92 forms.py:183 +msgid "The tenant does not belong to the selected tenant group." +msgstr "Der Mandant gehört nicht zur ausgewählten Mandantengruppe." + +#: forms.py:121 +msgid "Object type" +msgstr "Objekttyp" + +#: forms.py:123 tables.py:29 +msgid "NetBox object" +msgstr "NetBox-Objekt" + +#: forms.py:126 +msgid "Assign document" +msgstr "Dokumentation zuordnen" + +#: forms.py:158 +msgid "Parent folder" +msgstr "Übergeordneter Ordner" + +#: forms.py:188 +msgid "Word, Excel or PDF file" +msgstr "Word-, Excel- oder PDF-Datei" + +#: forms.py:190 +msgid "Title" +msgstr "Titel" + +#: forms.py:190 +msgid "" +"Leave empty to use the file name as title. Multi-sheet imports use the sheet " +"names." +msgstr "Leer lassen, um den Dateinamen als Titel zu verwenden. Beim Mehrblattimport werden die Blattnamen verwendet." + +#: forms.py:193 +msgid "Append to existing document" +msgstr "An bestehende Dokumentation anhängen" + +#: forms.py:193 +msgid "Adds the imported content to the end of an existing document." +msgstr "Fügt den importierten Inhalt am Ende einer vorhandenen Dokumentation an." + +#: forms.py:196 +msgid "Existing document" +msgstr "Bestehende Dokumentation" + +#: forms.py:196 +msgid "Target document for appending." +msgstr "Zieldokumentation für die Funktion Anhängen." + +#: forms.py:201 +msgid "Excel with multiple worksheets – one document per sheet" +msgstr "Excel mit mehreren Arbeitsblättern – je Blatt eine Dokumentation" + +#: forms.py:202 +msgid "" +"Creates a separate document in the selected target folder from every non-" +"empty Excel worksheet." +msgstr "Erstellt aus jedem nicht leeren Excel-Arbeitsblatt eine eigene Dokumentation im gewählten Zielordner." + +#: forms.py:208 +msgid "Flatten Excel tables" +msgstr "Excel-Tabellen glätten" + +#: forms.py:209 +msgid "" +"Imports plain cells outside tables as document-style text. Only ranges " +"explicitly defined in Excel via Insert → Table remain tables." +msgstr "Übernimmt normale Zellen ohne Tabelle als dokumentartigen Text. Nur in Excel ausdrücklich über Einfügen → Tabelle definierte Bereiche bleiben Tabellen." + +#: forms.py:214 +msgid "Target folder / category" +msgstr "Zielordner / Kategorie" + +#: forms.py:214 +msgid "Required for the Excel multi-sheet import." +msgstr "Für den Excel-Mehrblattimport verpflichtend." + +#: forms.py:226 +msgid "Select a document to append to." +msgstr "Zum Anhängen muss eine Dokumentation gewählt werden." + +#: forms.py:230 +msgid "The multi-sheet import requires an XLSX or XLSM file." +msgstr "Der Mehrblattimport benötigt eine XLSX- oder XLSM-Datei." + +#: forms.py:232 +msgid "Select a target folder for the generated documents." +msgstr "Bitte einen Zielordner für die erzeugten Dokumentationen auswählen." + +#: forms.py:234 +msgid "Multi-sheet import and appending cannot be combined." +msgstr "Mehrblattimport und Anhängen können nicht kombiniert werden." + +#: forms.py:237 views.py:543 +#, python-format +msgid "The file is larger than %(limit)s MB." +msgstr "Die Datei ist größer als %(limit)s MB." + +#: forms.py:244 +msgid "Folders and categories" +msgstr "Ordner und Kategorien" + +#: forms.py:245 +msgid "Search for and add one or more folders." +msgstr "Einen oder mehrere Ordner suchen und hinzufügen." + +#: forms.py:248 +msgid "Include subfolders" +msgstr "Unterordner einbeziehen" + +#: forms.py:249 +msgid "Exports documents from all subfolders." +msgstr "Exportiert Dokumentationen aus allen untergeordneten Ordnern." + +#: forms.py:261 +msgid "ZIP archive" +msgstr "ZIP-Archiv" + +#: forms.py:264 +msgid "Update existing documents with the same slug" +msgstr "Bestehende Dokumentationen mit gleicher Kennung aktualisieren" + +#: forms.py:265 +msgid "" +"Without this option, name conflicts create new documents with a numbered " +"slug." +msgstr "Ohne diese Option werden bei Namenskonflikten neue Dokumentationen mit einer fortlaufenden Kennung angelegt." + +#: forms.py:271 +msgid "Select a ZIP archive created by this plugin." +msgstr "Bitte ein vom Plugin erzeugtes ZIP-Archiv auswählen." + +#: forms.py:274 +#, python-format +msgid "The archive is larger than %(limit)s MB." +msgstr "Das Archiv ist größer als %(limit)s MB." + +#: forms.py:280 navigation.py:10 +#: templates/netbox_documentation/document_import.html:13 +#: templates/netbox_documentation/excel_import_preview.html:49 +msgid "Import" +msgstr "Importieren" + +#: forms.py:285 templates/netbox_documentation/excel_import_preview.html:53 +msgid "Document title" +msgstr "Dokumenttitel" + +#: forms.py:292 +msgid "A selected worksheet requires a title." +msgstr "Für ein ausgewähltes Arbeitsblatt ist ein Titel erforderlich." + +#: forms.py:303 +msgid "Select at least one worksheet." +msgstr "Bitte mindestens ein Arbeitsblatt auswählen." + +#: forms.py:306 +msgid "The worksheet selection is invalid." +msgstr "Die Arbeitsblattauswahl ist ungültig." + +#: forms.py:309 +msgid "Selected worksheets must not have the same document title." +msgstr "Ausgewählte Arbeitsblätter dürfen nicht denselben Dokumenttitel haben." + +#: importers.py:51 +msgid "Please save legacy .doc/.xls files as .docx/.xlsx first." +msgstr "Alte .doc/.xls-Dateien bitte zuerst als .docx/.xlsx speichern." + +#: importers.py:52 +msgid "Supported formats are DOCX, XLSX, XLSM, PDF, Markdown and text." +msgstr "Unterstützt werden DOCX, XLSX, XLSM, PDF, Markdown und Text." + +#: importers.py:100 +msgid "The workbook contains no data." +msgstr "Die Arbeitsmappe enthält keine Daten." + +#: importers.py:114 +msgid "The multi-sheet import supports XLSX and XLSM files." +msgstr "Der Mehrblattimport unterstützt XLSX- und XLSM-Dateien." + +#: importers.py:161 +msgid "The workbook contains no data or supported images." +msgstr "Die Arbeitsmappe enthält keine Daten oder unterstützten Bilder." + +#: importers.py:353 +#, python-format +msgid "Preview limited to %(rows)s rows." +msgstr "Vorschau auf %(rows)s Zeilen begrenzt." + +#: importers.py:403 +#, python-format +msgid "Preview limited to %(rows)s of %(total)s rows." +msgstr "Vorschau auf %(rows)s von %(total)s Zeilen begrenzt." + +#: importers.py:415 +#, python-format +msgid "Page %(number)s" +msgstr "Seite %(number)s" + +#: importers.py:417 +msgid "The PDF contains no extractable text. Scanned documents require OCR." +msgstr "Das PDF enthält keinen extrahierbaren Text. Für Scans ist OCR erforderlich." + +#: importers.py:418 +msgid "PDF layout and images cannot be imported completely." +msgstr "PDF-Layout und Bilder können nicht vollständig übernommen werden." + +#: models.py:12 +msgid "Rich text" +msgstr "Rich Text" + +#: models.py:12 models.py:18 +msgid "Markdown" +msgstr "Markdown" + +#: models.py:16 +msgid "title" +msgstr "Titel" + +#: models.py:17 models.py:82 +msgid "slug" +msgstr "Kennung" + +#: models.py:18 +msgid "body" +msgstr "Inhalt" + +#: models.py:19 +msgid "body format" +msgstr "Inhaltsformat" + +#: models.py:20 +msgid "summary" +msgstr "Zusammenfassung" + +#: models.py:21 +msgid "published" +msgstr "veröffentlicht" + +#: models.py:22 models.py:97 +msgid "folder" +msgstr "Ordner" + +#: models.py:25 models.py:87 +msgid "tenant group" +msgstr "Mandantengruppe" + +#: models.py:29 models.py:91 +msgid "tenant" +msgstr "Mandant" + +#: models.py:34 models.py:138 models.py:167 +msgid "document" +msgstr "Dokumentation" + +#: models.py:35 +msgid "documents" +msgstr "Dokumentationen" + +#: models.py:81 +msgid "name" +msgstr "Name" + +#: models.py:83 +msgid "parent folder" +msgstr "übergeordneter Ordner" + +#: models.py:84 +msgid "description" +msgstr "Beschreibung" + +#: models.py:98 +msgid "folders" +msgstr "Ordner" + +#: models.py:132 +msgid "A folder cannot be placed inside itself or one of its subfolders." +msgstr "Ein Ordner kann nicht sich selbst oder einem Unterordner untergeordnet werden." + +#: models.py:139 +msgid "object type" +msgstr "Objekttyp" + +#: models.py:140 +msgid "object ID" +msgstr "Objekt-ID" + +#: models.py:142 +msgid "note" +msgstr "Notiz" + +#: models.py:146 +msgid "document assignment" +msgstr "Dokumentzuordnung" + +#: models.py:147 +msgid "document assignments" +msgstr "Dokumentzuordnungen" + +#: models.py:168 +msgid "file" +msgstr "Datei" + +#: models.py:169 +msgid "original name" +msgstr "Originalname" + +#: models.py:170 +msgid "content type" +msgstr "Inhaltstyp" + +#: models.py:171 +msgid "size" +msgstr "Größe" + +#: models.py:175 +msgid "attachment" +msgstr "Anhang" + +#: models.py:176 +msgid "attachments" +msgstr "Anhänge" + +#: navigation.py:6 templates/netbox_documentation/inc/object_documents.html:3 +msgid "Documentation" +msgstr "Dokumentation" + +#: navigation.py:7 +msgid "Wiki" +msgstr "Wiki" + +#: navigation.py:8 tables.py:19 +#: templates/netbox_documentation/document_tree.html:4 +#: templates/netbox_documentation/document_tree.html:36 +#: templates/netbox_documentation/document_tree.html:44 +#: templates/netbox_documentation/documentcategory.html:36 +msgid "Documents" +msgstr "Dokumentationen" + +#: navigation.py:9 +msgid "New" +msgstr "Neu" + +#: navigation.py:12 tables.py:9 +#: templates/netbox_documentation/document.html:133 +msgid "Assignments" +msgstr "Zuordnungen" + +#: navigation.py:13 templates/netbox_documentation/inc/object_documents.html:11 +msgid "Assign" +msgstr "Zuordnen" + +#: navigation.py:15 templates/netbox_documentation/documentcategory_tree.html:4 +msgid "Folders & categories" +msgstr "Ordner & Kategorien" + +#: navigation.py:16 +#: templates/netbox_documentation/documentcategory_tree.html:12 +msgid "Create folder" +msgstr "Ordner erstellen" + +#: navigation.py:18 +msgid "ZIP export & import" +msgstr "ZIP Export & Import" + +#: templates/netbox_documentation/document.html:113 +msgid "Focus view" +msgstr "Großansicht" + +#: templates/netbox_documentation/document.html:116 +msgid "Print / PDF" +msgstr "Drucken / PDF" + +#: templates/netbox_documentation/document.html:123 +msgid "Exit focus view" +msgstr "Großansicht beenden" + +#: templates/netbox_documentation/document.html:128 +#: templates/netbox_documentation/documentcategory.html:18 +msgid "Tenancy" +msgstr "Mandantenzuordnung" + +#: templates/netbox_documentation/document.html:134 +msgid "Not assigned yet" +msgstr "Noch nicht zugeordnet" + +#: templates/netbox_documentation/document.html:136 +msgid "Original files" +msgstr "Originaldateien" + +#: templates/netbox_documentation/document.html:163 +msgid "Open table in focus view" +msgstr "Tabelle in Großansicht öffnen" + +#: templates/netbox_documentation/document.html:178 +#: templates/netbox_documentation/document.html:195 +msgid "Copy" +msgstr "Kopieren" + +#: templates/netbox_documentation/document.html:194 +msgid "Copied" +msgstr "Kopiert" + +#: templates/netbox_documentation/document_archive.html:5 +msgid "Documentation archive" +msgstr "Dokumentationsarchiv" + +#: templates/netbox_documentation/document_archive.html:11 +msgid "Export documents" +msgstr "Dokumentationen exportieren" + +#: templates/netbox_documentation/document_archive.html:13 +msgid "" +"Search for and add several folders. All contained documents are downloaded " +"together with their object assignments and attachments." +msgstr "Mehrere Ordner suchen und hinzufügen. Alle enthaltenen Dokumentationen werden gemeinsam mit Objektzuordnungen und Anhängen heruntergeladen." + +#: templates/netbox_documentation/document_archive.html:18 +msgid "Download ZIP" +msgstr "ZIP herunterladen" + +#: templates/netbox_documentation/document_archive.html:25 +msgid "Import documents" +msgstr "Dokumentationen importieren" + +#: templates/netbox_documentation/document_archive.html:27 +msgid "" +"Upload a ZIP archive previously created with this plugin. Missing NetBox " +"target objects are skipped safely." +msgstr "Ein zuvor mit diesem Plugin erzeugtes ZIP-Archiv hochladen. Nicht vorhandene NetBox-Zielobjekte werden sicher übersprungen." + +#: templates/netbox_documentation/document_archive.html:32 +msgid "Import ZIP" +msgstr "ZIP importieren" + +#: templates/netbox_documentation/document_edit.html:23 +msgid "" +"The rich text editor could not be loaded from the local plugin endpoint. " +"Please check the browser console and network log." +msgstr "Der Rich-Text-Editor konnte nicht vom lokalen Plugin-Endpunkt geladen werden. Bitte Browser-Konsole und Netzwerkprotokoll prüfen." + +#: templates/netbox_documentation/document_edit.html:53 +msgid "Standard with borders" +msgstr "Standard mit Rahmen" + +#: templates/netbox_documentation/document_edit.html:54 +msgid "Compact" +msgstr "Kompakt" + +#: templates/netbox_documentation/document_edit.html:55 +msgid "Striped rows" +msgstr "Gestreifte Zeilen" + +#: templates/netbox_documentation/document_edit.html:56 +msgid "Blue header" +msgstr "Blaue Kopfzeile" + +#: templates/netbox_documentation/document_edit.html:57 +msgid "Green header" +msgstr "Grüne Kopfzeile" + +#: templates/netbox_documentation/document_edit.html:58 +msgid "Dark header" +msgstr "Dunkle Kopfzeile" + +#: templates/netbox_documentation/document_edit.html:59 +msgid "No borders" +msgstr "Ohne Rahmen" + +#: templates/netbox_documentation/document_edit.html:60 +msgid "Full width" +msgstr "Volle Breite" + +#: templates/netbox_documentation/document_edit.html:63 +msgid "Normal" +msgstr "Normal" + +#: templates/netbox_documentation/document_edit.html:64 +msgid "Highlight yellow" +msgstr "Gelb hervorheben" + +#: templates/netbox_documentation/document_edit.html:65 +msgid "Highlight green" +msgstr "Grün hervorheben" + +#: templates/netbox_documentation/document_edit.html:66 +msgid "Highlight red" +msgstr "Rot hervorheben" + +#: templates/netbox_documentation/document_edit.html:67 +msgid "Highlight blue" +msgstr "Blau hervorheben" + +#: templates/netbox_documentation/document_edit.html:68 +msgid "Vertically centred" +msgstr "Vertikal mittig" + +#: templates/netbox_documentation/document_edit.html:72 +msgid "Table cell: yellow" +msgstr "Tabellenzelle: Gelb" + +#: templates/netbox_documentation/document_edit.html:73 +msgid "Table cell: green" +msgstr "Tabellenzelle: Grün" + +#: templates/netbox_documentation/document_edit.html:74 +msgid "Table cell: red" +msgstr "Tabellenzelle: Rot" + +#: templates/netbox_documentation/document_edit.html:75 +msgid "Table cell: blue" +msgstr "Tabellenzelle: Blau" + +#: templates/netbox_documentation/document_edit.html:102 +msgid "Cisco / network configuration" +msgstr "Cisco / Netzwerk-Konfiguration" + +#: templates/netbox_documentation/document_edit.html:109 +msgid "Plain text" +msgstr "Nur Text" + +#: templates/netbox_documentation/document_edit.html:134 +msgid "Supported formats are PNG, JPEG, GIF and WebP." +msgstr "Unterstützt werden PNG, JPEG, GIF und WebP." + +#: templates/netbox_documentation/document_edit.html:142 +msgid "The image could not be read." +msgstr "Das Bild konnte nicht gelesen werden." + +#: templates/netbox_documentation/document_edit.html:177 +msgid "Yellow" +msgstr "Gelb" + +#: templates/netbox_documentation/document_edit.html:177 +msgid "Green" +msgstr "Grün" + +#: templates/netbox_documentation/document_edit.html:177 +msgid "Blue" +msgstr "Blau" + +#: templates/netbox_documentation/document_edit.html:178 +msgid "Red" +msgstr "Rot" + +#: templates/netbox_documentation/document_edit.html:178 +msgid "Orange" +msgstr "Orange" + +#: templates/netbox_documentation/document_edit.html:178 +msgid "Grey" +msgstr "Grau" + +#: templates/netbox_documentation/document_edit.html:179 +msgid "Dark green" +msgstr "Dunkelgrün" + +#: templates/netbox_documentation/document_edit.html:179 +msgid "Dark blue" +msgstr "Dunkelblau" + +#: templates/netbox_documentation/document_edit.html:179 +msgid "Dark grey" +msgstr "Dunkelgrau" + +#: templates/netbox_documentation/document_edit.html:183 +msgid "Table cell colour" +msgstr "Farbeimer für Tabellenzellen" + +#: templates/netbox_documentation/document_edit.html:191 +msgid "Custom colour …" +msgstr "Eigene Farbe …" + +#: templates/netbox_documentation/document_edit.html:192 +msgid "Remove cell colour" +msgstr "Zellfarbe entfernen" + +#: templates/netbox_documentation/document_edit.html:209 +msgid "Upload failed" +msgstr "Upload fehlgeschlagen" + +#: templates/netbox_documentation/document_edit.html:221 +msgid "" +"Pasted images are stored automatically as media of the new document when it " +"is first saved. After the first save, direct image upload is also available." +msgstr "Eingefügte oder hineinkopierte Bilder werden beim ersten Speichern automatisch als Medien der neuen Dokumentation abgelegt. Nach dem ersten Speichern ist zusätzlich der direkte Bildupload verfügbar." + +#: templates/netbox_documentation/document_import.html:4 +msgid "Import document" +msgstr "Dokument importieren" + +#: templates/netbox_documentation/document_import.html:7 +msgid "Import Word, Excel or PDF" +msgstr "Word, Excel oder PDF importieren" + +#: templates/netbox_documentation/document_import.html:10 +#: templates/netbox_documentation/document_import.html:11 +msgid "Import notes" +msgstr "Importhinweise" + +#: templates/netbox_documentation/document_import.html:11 +msgid "" +"DOCX keeps headings, lists and tables. A regular XLSX import merges all " +"sheets. The multi-sheet import creates one document per sheet in the target " +"folder. PDF requires a real text layer; OCR for scans is not included." +msgstr "DOCX übernimmt Überschriften, Listen und Tabellen. Beim normalen XLSX-Import werden alle Blätter zusammengeführt. Der Mehrblattimport erzeugt je Blatt eine Dokumentation im Zielordner. PDF benötigt eine echte Textebene; Scan-OCR ist nicht enthalten." + +#: templates/netbox_documentation/document_print.html:7 +msgid "Print view" +msgstr "Druckansicht" + +#: templates/netbox_documentation/document_print.html:60 +msgid "Print / save as PDF" +msgstr "Drucken / Als PDF speichern" + +#: templates/netbox_documentation/document_print.html:61 +msgid "Portrait" +msgstr "Hochformat" + +#: templates/netbox_documentation/document_print.html:62 +msgid "Landscape" +msgstr "Querformat" + +#: templates/netbox_documentation/document_print.html:63 +msgid "Back to document" +msgstr "Zurück zur Dokumentation" + +#: templates/netbox_documentation/document_print.html:71 +msgid "Last updated" +msgstr "Stand" + +#: templates/netbox_documentation/document_print.html:72 +msgid "Assigned to" +msgstr "Zugeordnet" + +#: templates/netbox_documentation/document_tree.html:9 +msgid "Search documents & folders…" +msgstr "Dokumente & Ordner durchsuchen…" + +#: templates/netbox_documentation/document_tree.html:12 +msgid "Add" +msgstr "Hinzufügen" + +#: templates/netbox_documentation/document_tree.html:15 +#: templates/netbox_documentation/document_tree.html:136 +msgid "New folder" +msgstr "Neuer Ordner" + +#: templates/netbox_documentation/document_tree.html:17 +msgid "View" +msgstr "Ansicht" + +#: templates/netbox_documentation/document_tree.html:18 +msgid "Explorer view" +msgstr "Explorer-Ansicht" + +#: templates/netbox_documentation/document_tree.html:18 +msgid "Explorer" +msgstr "Explorer" + +#: templates/netbox_documentation/document_tree.html:19 +msgid "Tree view" +msgstr "Baumansicht" + +#: templates/netbox_documentation/document_tree.html:19 +msgid "Tree" +msgstr "Baum" + +#: templates/netbox_documentation/document_tree.html:20 +#: templates/netbox_documentation/documentcategory_tree.html:14 +msgid "List view" +msgstr "Listenansicht" + +#: templates/netbox_documentation/document_tree.html:20 +msgid "List" +msgstr "Liste" + +#: templates/netbox_documentation/document_tree.html:29 +msgid "Back" +msgstr "Zurück" + +#: templates/netbox_documentation/document_tree.html:30 +msgid "Parent folder (Backspace)" +msgstr "Übergeordneter Ordner (Rücktaste)" + +#: templates/netbox_documentation/document_tree.html:32 +#: templates/netbox_documentation/document_tree.html:139 +msgid "Folder details" +msgstr "Ordnerdetails" + +#: templates/netbox_documentation/document_tree.html:56 +msgid "No matches found." +msgstr "Keine Treffer gefunden." + +#: templates/netbox_documentation/document_tree.html:83 +msgid "No documents yet." +msgstr "Noch keine Dokumentationen vorhanden." + +#: templates/netbox_documentation/document_tree.html:134 +msgid "{folders} folders, {documents} documents" +msgstr "{folders} Ordner, {documents} Dokument(e)" + +#: templates/netbox_documentation/document_tree.html:135 +msgid "Search results in all folders: " +msgstr "Suchergebnisse in allen Ordnern: " + +#: templates/netbox_documentation/document_tree.html:137 +msgid "New document" +msgstr "Neues Dokument" + +#: templates/netbox_documentation/document_tree.html:138 +msgid "Export folder as ZIP" +msgstr "Ordner als ZIP exportieren" + +#: templates/netbox_documentation/document_tree.html:140 +msgid "Refresh" +msgstr "Aktualisieren" + +#: templates/netbox_documentation/document_tree.html:141 +msgid "Open" +msgstr "Öffnen" + +#: templates/netbox_documentation/document_tree.html:142 +msgid "New subfolder" +msgstr "Neuer Unterordner" + +#: templates/netbox_documentation/document_tree.html:143 +msgid "New document here" +msgstr "Neues Dokument hier" + +#: templates/netbox_documentation/document_tree.html:144 +msgid "Rename / edit" +msgstr "Umbenennen / Bearbeiten" + +#: templates/netbox_documentation/document_tree.html:145 +msgid "Export as ZIP" +msgstr "Als ZIP exportieren" + +#: templates/netbox_documentation/document_tree.html:146 +msgid "Copy link" +msgstr "Link kopieren" + +#: templates/netbox_documentation/document_tree.html:147 +msgid "Delete" +msgstr "Löschen" + +#: templates/netbox_documentation/document_tree.html:148 +msgid "Open in new tab" +msgstr "In neuem Tab öffnen" + +#: templates/netbox_documentation/document_tree.html:149 +msgid "Print / export as PDF" +msgstr "Drucken / als PDF exportieren" + +#: templates/netbox_documentation/document_tree.html:150 +msgid "Close" +msgstr "Schließen" + +#: templates/netbox_documentation/document_tree.html:151 +#: templates/netbox_documentation/inc/explorer_pane.html:9 +msgid "This folder is empty." +msgstr "Dieser Ordner ist leer." + +#: templates/netbox_documentation/document_tree.html:152 +msgid "Unexpected response from the server ({status})." +msgstr "Unerwartete Antwort vom Server ({status})." + +#: templates/netbox_documentation/document_tree.html:153 +msgid "“{document}” moved to “{folder}”." +msgstr "„{document}“ verschoben nach „{folder}“." + +#: templates/netbox_documentation/document_tree.html:154 +msgid "Move failed – no connection to the server." +msgstr "Verschieben fehlgeschlagen – keine Verbindung zum Server." + +#: templates/netbox_documentation/documentcategory.html:5 +msgid "Breadcrumb" +msgstr "Brotkrumennavigation" + +#: templates/netbox_documentation/documentcategory.html:7 +msgid "Folders" +msgstr "Ordner" + +#: templates/netbox_documentation/documentcategory.html:26 +msgid "Subfolders" +msgstr "Unterordner" + +#: templates/netbox_documentation/documentcategory.html:30 +msgid "No subfolders" +msgstr "Keine Unterordner" + +#: templates/netbox_documentation/documentcategory.html:40 +msgid "No documents in this folder" +msgstr "Keine Dokumentationen in diesem Ordner" + +#: templates/netbox_documentation/documentcategory_tree.html:9 +msgid "Search folders…" +msgstr "Ordner durchsuchen…" + +#: templates/netbox_documentation/documentcategory_tree.html:27 +msgid "No folders yet." +msgstr "Noch keine Ordner vorhanden." + +#: templates/netbox_documentation/excel_import_preview.html:5 +msgid "Excel import preview" +msgstr "Excel-Importvorschau" + +#: templates/netbox_documentation/excel_import_preview.html:21 +msgid "File" +msgstr "Datei" + +#: templates/netbox_documentation/excel_import_preview.html:22 +msgid "Target folder" +msgstr "Zielordner" + +#: templates/netbox_documentation/excel_import_preview.html:22 +msgid "No longer exists" +msgstr "Nicht mehr vorhanden" + +#: templates/netbox_documentation/excel_import_preview.html:23 +msgid "Flatten" +msgstr "Glätten" + +#: templates/netbox_documentation/excel_import_preview.html:23 +msgid "Yes" +msgstr "Ja" + +#: templates/netbox_documentation/excel_import_preview.html:23 +msgid "No" +msgstr "Nein" + +#: templates/netbox_documentation/excel_import_preview.html:33 +msgid "Update existing documents?" +msgstr "Bestehende Dokumentationen aktualisieren?" + +#: templates/netbox_documentation/excel_import_preview.html:34 +msgid "" +"The following documents already exist in the target folder. Their content " +"will be overwritten; existing NetBox assignments are kept:" +msgstr "Die folgenden Dokumentationen existieren bereits im Zielordner. Ihr Inhalt wird überschrieben; bestehende NetBox-Zuordnungen bleiben erhalten:" + +#: templates/netbox_documentation/excel_import_preview.html:58 +#, python-format +msgid "%(counter)s image" +msgid_plural "%(counter)s images" +msgstr[0] "%(counter)s Bild" +msgstr[1] "%(counter)s Bilder" + +#: templates/netbox_documentation/excel_import_preview.html:64 +msgid "Show preview of the generated document" +msgstr "Vorschau der erzeugten Dokumentation anzeigen" + +#: templates/netbox_documentation/excel_import_preview.html:75 +msgid "Cancel" +msgstr "Abbrechen" + +#: templates/netbox_documentation/excel_import_preview.html:78 +msgid "Overwrite and import" +msgstr "Überschreiben und importieren" + +#: templates/netbox_documentation/excel_import_preview.html:78 +msgid "Import selected worksheets" +msgstr "Ausgewählte Arbeitsblätter importieren" + +#: templates/netbox_documentation/inc/category_tree_node.html:11 +#: templates/netbox_documentation/inc/category_tree_node.html:27 +msgid "Edit" +msgstr "Bearbeiten" + +#: templates/netbox_documentation/inc/document_tree_file.html:6 +#: templates/netbox_documentation/inc/explorer_file_tile.html:8 +msgid "Draft" +msgstr "Entwurf" + +#: templates/netbox_documentation/inc/document_tree_node.html:17 +msgid "Empty" +msgstr "Leer" + +#: templates/netbox_documentation/inc/explorer_folder_tile.html:8 +#, python-format +msgid "%(counter)s item" +msgid_plural "%(counter)s items" +msgstr[0] "%(counter)s Element" +msgstr[1] "%(counter)s Elemente" + +#: templates/netbox_documentation/inc/object_documents.html:9 +msgid "No documents assigned." +msgstr "Keine Dokumentation zugeordnet." + +#: views.py:142 +msgid "The target folder does not exist." +msgstr "Der Zielordner existiert nicht." + +#: views.py:259 +#, python-format +msgid "Import failed: %(error)s" +msgstr "Import fehlgeschlagen: %(error)s" + +#: views.py:293 +#, python-format +msgid "%(name)s was imported." +msgstr "%(name)s wurde importiert." + +#: views.py:303 +#, python-format +msgid "Excel multi-sheet import failed: %(error)s" +msgstr "Excel-Mehrblattimport fehlgeschlagen: %(error)s" + +#: views.py:348 +#, python-format +msgid "%(count)s embedded image will be attached on import." +msgid_plural "%(count)s embedded images will be attached on import." +msgstr[0] "%(count)s eingebettetes Bild wird beim Import angefügt." +msgstr[1] "%(count)s eingebettete Bilder werden beim Import angefügt." + +#: views.py:352 views.py:504 views.py:506 +msgid "Images" +msgstr "Bilder" + +#: views.py:359 +msgid "… preview truncated …" +msgstr "… Vorschau gekürzt …" + +#: views.py:377 +msgid "This import preview has expired. Please upload the Excel file again." +msgstr "Diese Importvorschau ist abgelaufen. Bitte die Exceldatei erneut hochladen." + +#: views.py:383 +#, python-format +msgid "The Excel preview could not be created: %(error)s" +msgstr "Die Excel-Vorschau konnte nicht erzeugt werden: %(error)s" + +#: views.py:392 +msgid "Excel import was cancelled." +msgstr "Excel-Import wurde abgebrochen." + +#: views.py:400 +#, python-format +msgid "The Excel file could not be read again: %(error)s" +msgstr "Die Exceldatei konnte nicht erneut gelesen werden: %(error)s" + +#: views.py:405 +msgid "" +"The selected target folder no longer exists. Please start the import again." +msgstr "Der gewählte Zielordner existiert nicht mehr. Bitte den Import erneut starten." + +#: views.py:427 +msgid "You are not allowed to update at least one document with the same name." +msgstr "Mindestens eine gleichnamige Dokumentation darf nicht aktualisiert werden." + +#: views.py:433 +#, python-format +msgid "The confirmation could not be displayed: %(error)s" +msgstr "Die Bestätigung konnte nicht angezeigt werden: %(error)s" + +#: views.py:442 +#, python-format +msgid "The selected Excel sheets could not be imported: %(error)s" +msgstr "Die ausgewählten Excel-Blätter konnten nicht importiert werden: %(error)s" + +#: views.py:448 +#, python-format +msgid "" +"%(documents)s worksheets processed (%(created)s new, %(updated)s updated) in " +"“%(category)s”; %(images)s images imported." +msgstr "%(documents)s Arbeitsblätter verarbeitet (%(created)s neu, %(updated)s aktualisiert) in „%(category)s“; %(images)s Bilder übernommen." + +#: views.py:467 views.py:484 +#, python-format +msgid "Imported from %(name)s" +msgstr "Importiert aus %(name)s" + +#: views.py:540 +msgid "No file received." +msgstr "Keine Datei empfangen." + +#: views.py:546 +msgid "The editor accepts JPEG, PNG, GIF and WebP." +msgstr "Im Editor sind JPEG, PNG, GIF und WebP erlaubt." + +#: views.py:553 +msgid "The uploaded file is not a valid image." +msgstr "Die hochgeladene Datei ist kein gültiges Bild." + +#: views.py:587 +msgid "The selected folders contain no exportable documents." +msgstr "Die ausgewählten Ordner enthalten keine exportierbaren Dokumentationen." + +#: views.py:613 +#, python-format +msgid "Archive imported: %(created)s created, %(updated)s updated." +msgstr "Archiv importiert: %(created)s erstellt, %(updated)s aktualisiert." + +#: views.py:616 +#, python-format +msgid "%(skipped)s unavailable object assignments were skipped." +msgstr "%(skipped)s nicht verfügbare Objektzuordnungen wurden übersprungen." diff --git a/netbox_documentation/models.py b/netbox_documentation/models.py index fa73a1e..317afe9 100644 --- a/netbox_documentation/models.py +++ b/netbox_documentation/models.py @@ -3,33 +3,36 @@ from django.contrib.contenttypes.models import ContentType from django.db import models from django.conf import settings from django.urls import reverse +from django.utils.translation import gettext_lazy as _ from pathlib import Path import uuid from netbox.models import NetBoxModel -BODY_FORMAT_CHOICES = (("html", "Rich Text"), ("markdown", "Markdown")) +BODY_FORMAT_CHOICES = (("html", _("Rich text")), ("markdown", _("Markdown"))) class Document(NetBoxModel): - title = models.CharField(max_length=200) - slug = models.SlugField(max_length=200, unique=True) - body = models.TextField(blank=True, help_text="Markdown") - body_format = models.CharField(max_length=10, choices=BODY_FORMAT_CHOICES, default="html") - summary = models.CharField(max_length=500, blank=True) - is_published = models.BooleanField(default=True) - category = models.ForeignKey("DocumentCategory", on_delete=models.SET_NULL, null=True, blank=True, related_name="documents") + title = models.CharField(_("title"), max_length=200) + slug = models.SlugField(_("slug"), max_length=200, unique=True) + body = models.TextField(_("body"), blank=True, help_text=_("Markdown")) + body_format = models.CharField(_("body format"), max_length=10, choices=BODY_FORMAT_CHOICES, default="html") + summary = models.CharField(_("summary"), max_length=500, blank=True) + is_published = models.BooleanField(_("published"), default=True) + category = models.ForeignKey("DocumentCategory", on_delete=models.SET_NULL, null=True, blank=True, related_name="documents", verbose_name=_("folder")) tenant_group = models.ForeignKey( "tenancy.TenantGroup", on_delete=models.SET_NULL, null=True, blank=True, - related_name="documentation_documents", + related_name="documentation_documents", verbose_name=_("tenant group"), ) tenant = models.ForeignKey( "tenancy.Tenant", on_delete=models.SET_NULL, null=True, blank=True, - related_name="documentation_documents", + related_name="documentation_documents", verbose_name=_("tenant"), ) class Meta: ordering = ("title",) + verbose_name = _("document") + verbose_name_plural = _("documents") permissions = (("import_document", "Can import office documents"),) def __str__(self): @@ -75,23 +78,24 @@ class Document(NetBoxModel): class DocumentCategory(NetBoxModel): - name = models.CharField(max_length=100) - slug = models.SlugField(max_length=100) - parent = models.ForeignKey("self", on_delete=models.CASCADE, null=True, blank=True, related_name="children") - description = models.CharField(max_length=500, blank=True) + name = models.CharField(_("name"), max_length=100) + slug = models.SlugField(_("slug"), max_length=100) + parent = models.ForeignKey("self", on_delete=models.CASCADE, null=True, blank=True, related_name="children", verbose_name=_("parent folder")) + description = models.CharField(_("description"), max_length=500, blank=True) tenant_group = models.ForeignKey( "tenancy.TenantGroup", on_delete=models.SET_NULL, null=True, blank=True, - related_name="documentation_categories", + related_name="documentation_categories", verbose_name=_("tenant group"), ) tenant = models.ForeignKey( "tenancy.Tenant", on_delete=models.SET_NULL, null=True, blank=True, - related_name="documentation_categories", + related_name="documentation_categories", verbose_name=_("tenant"), ) class Meta: ordering = ("name",) constraints = [models.UniqueConstraint(fields=("parent", "slug"), name="%(app_label)s_%(class)s_unique_parent_slug")] - verbose_name_plural = "document categories" + verbose_name = _("folder") + verbose_name_plural = _("folders") def __str__(self): names = [self.name] @@ -125,20 +129,22 @@ class DocumentCategory(NetBoxModel): seen = {self.pk} if self.pk else set() while parent: if parent.pk in seen: - raise ValidationError({"parent": "Ein Ordner kann nicht sich selbst oder einem Unterordner untergeordnet werden."}) + raise ValidationError({"parent": _("A folder cannot be placed inside itself or one of its subfolders.")}) seen.add(parent.pk) parent = parent.parent class DocumentAssignment(NetBoxModel): - document = models.ForeignKey(Document, on_delete=models.CASCADE, related_name="assignments") - assigned_object_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) - assigned_object_id = models.PositiveBigIntegerField() + document = models.ForeignKey(Document, on_delete=models.CASCADE, related_name="assignments", verbose_name=_("document")) + assigned_object_type = models.ForeignKey(ContentType, on_delete=models.CASCADE, verbose_name=_("object type")) + assigned_object_id = models.PositiveBigIntegerField(_("object ID")) assigned_object = GenericForeignKey("assigned_object_type", "assigned_object_id") - note = models.CharField(max_length=200, blank=True) + note = models.CharField(_("note"), max_length=200, blank=True) class Meta: ordering = ("document", "assigned_object_type", "assigned_object_id") + verbose_name = _("document assignment") + verbose_name_plural = _("document assignments") constraints = [models.UniqueConstraint( fields=("document", "assigned_object_type", "assigned_object_id"), name="%(app_label)s_%(class)s_unique_assignment", @@ -158,14 +164,16 @@ def attachment_upload_path(instance, filename): class DocumentAttachment(NetBoxModel): - document = models.ForeignKey(Document, on_delete=models.CASCADE, related_name="attachments") - file = models.FileField(upload_to=attachment_upload_path) - original_name = models.CharField(max_length=255) - content_type = models.CharField(max_length=100, blank=True) - size = models.PositiveBigIntegerField(default=0) + document = models.ForeignKey(Document, on_delete=models.CASCADE, related_name="attachments", verbose_name=_("document")) + file = models.FileField(_("file"), upload_to=attachment_upload_path) + original_name = models.CharField(_("original name"), max_length=255) + content_type = models.CharField(_("content type"), max_length=100, blank=True) + size = models.PositiveBigIntegerField(_("size"), default=0) class Meta: ordering = ("original_name",) + verbose_name = _("attachment") + verbose_name_plural = _("attachments") def __str__(self): return self.original_name diff --git a/netbox_documentation/navigation.py b/netbox_documentation/navigation.py index c2eb13b..a249132 100644 --- a/netbox_documentation/navigation.py +++ b/netbox_documentation/navigation.py @@ -1,20 +1,21 @@ +from django.utils.translation import gettext_lazy as _ from netbox.plugins import PluginMenu, PluginMenuButton, PluginMenuItem from netbox.choices import ButtonColorChoices menu = PluginMenu( - label="Dokumentation", - groups=(("Wiki", ( - PluginMenuItem(link="plugins:netbox_documentation:document_tree", link_text="Dokumentationen", buttons=( - PluginMenuButton(link="plugins:netbox_documentation:document_add", title="Neu", icon_class="mdi mdi-plus-thick", color=ButtonColorChoices.GREEN), - PluginMenuButton(link="plugins:netbox_documentation:document_import", title="Import", icon_class="mdi mdi-file-import", color=ButtonColorChoices.BLUE), + label=_("Documentation"), + groups=((_("Wiki"), ( + PluginMenuItem(link="plugins:netbox_documentation:document_tree", link_text=_("Documents"), buttons=( + PluginMenuButton(link="plugins:netbox_documentation:document_add", title=_("New"), icon_class="mdi mdi-plus-thick", color=ButtonColorChoices.GREEN), + PluginMenuButton(link="plugins:netbox_documentation:document_import", title=_("Import"), icon_class="mdi mdi-file-import", color=ButtonColorChoices.BLUE), )), - PluginMenuItem(link="plugins:netbox_documentation:documentassignment_list", link_text="Zuordnungen", buttons=( - PluginMenuButton(link="plugins:netbox_documentation:documentassignment_add", title="Zuordnen", icon_class="mdi mdi-link-plus", color=ButtonColorChoices.GREEN), + PluginMenuItem(link="plugins:netbox_documentation:documentassignment_list", link_text=_("Assignments"), buttons=( + PluginMenuButton(link="plugins:netbox_documentation:documentassignment_add", title=_("Assign"), icon_class="mdi mdi-link-plus", color=ButtonColorChoices.GREEN), )), - PluginMenuItem(link="plugins:netbox_documentation:documentcategory_tree", link_text="Ordner & Kategorien", buttons=( - PluginMenuButton(link="plugins:netbox_documentation:documentcategory_add", title="Ordner erstellen", icon_class="mdi mdi-folder-plus", color=ButtonColorChoices.GREEN), + PluginMenuItem(link="plugins:netbox_documentation:documentcategory_tree", link_text=_("Folders & categories"), buttons=( + PluginMenuButton(link="plugins:netbox_documentation:documentcategory_add", title=_("Create folder"), icon_class="mdi mdi-folder-plus", color=ButtonColorChoices.GREEN), )), - PluginMenuItem(link="plugins:netbox_documentation:document_archive", link_text="ZIP Export & Import"), + PluginMenuItem(link="plugins:netbox_documentation:document_archive", link_text=_("ZIP export & import")), )),), icon_class="mdi mdi-book-open-page-variant", ) diff --git a/netbox_documentation/tables.py b/netbox_documentation/tables.py index e80545d..191e8d1 100644 --- a/netbox_documentation/tables.py +++ b/netbox_documentation/tables.py @@ -1,11 +1,12 @@ import django_tables2 as tables +from django.utils.translation import gettext_lazy as _ from netbox.tables import NetBoxTable, columns from .models import Document, DocumentAssignment, DocumentCategory class DocumentTable(NetBoxTable): title = tables.Column(linkify=True) - assignments = tables.Column(accessor="assignments.count", verbose_name="Zuordnungen", orderable=False) + assignments = tables.Column(accessor="assignments.count", verbose_name=_("Assignments"), orderable=False) actions = columns.ActionsColumn(actions=("edit", "delete")) class Meta(NetBoxTable.Meta): @@ -14,8 +15,8 @@ class DocumentTable(NetBoxTable): class DocumentCategoryTable(NetBoxTable): - name = tables.Column(linkify=True, verbose_name="Ordner") - document_count = tables.Column(accessor="documents.count", verbose_name="Dokumente", orderable=False) + name = tables.Column(linkify=True, verbose_name=_("Folder")) + document_count = tables.Column(accessor="documents.count", verbose_name=_("Documents"), orderable=False) actions = columns.ActionsColumn(actions=("edit", "delete")) class Meta(NetBoxTable.Meta): @@ -25,7 +26,7 @@ class DocumentCategoryTable(NetBoxTable): class AssignmentTable(NetBoxTable): document = tables.Column(linkify=True) - assigned_object = tables.Column(linkify=True, verbose_name="NetBox-Objekt") + assigned_object = tables.Column(linkify=True, verbose_name=_("NetBox object")) actions = columns.ActionsColumn(actions=("edit", "delete")) class Meta(NetBoxTable.Meta): diff --git a/netbox_documentation/templates/netbox_documentation/document.html b/netbox_documentation/templates/netbox_documentation/document.html index e28e8d8..b5b703d 100644 --- a/netbox_documentation/templates/netbox_documentation/document.html +++ b/netbox_documentation/templates/netbox_documentation/document.html @@ -1,4 +1,5 @@ {% extends 'generic/object.html' %} +{% load i18n %} {% load helpers %} {% block head %} {{ block.super }} @@ -109,30 +110,30 @@ {% endblock head %} {% block extra_controls %} - Drucken / PDF + {% trans "Print / PDF" %} {% endblock extra_controls %} {% block content %}

{{ object.title }}

- + {% if object.summary %}

{{ object.summary }}

{% endif %}
{{ object.rendered_body|safe }}
- {% if object.tenant_group or object.tenant %}
Mandantenzuordnung
+ {% if object.tenant_group or object.tenant %}
{% trans "Tenancy" %}
{% if object.tenant_group %} {{ object.tenant_group }}{% endif %} {% if object.tenant %} {{ object.tenant }}{% endif %}
{% endif %} - {% if object.category %}{% endif %} -
Zuordnungen
- {% for assignment in object.assignments.all %}{{ assignment.assigned_object_type }}: {{ assignment.assigned_object }}{% empty %}
Noch nicht zugeordnet
{% endfor %} + {% if object.category %}
{% trans "Folder" %}
{{ object.category }}
{% endif %} +
{% trans "Assignments" %}
+ {% for assignment in object.assignments.all %}{{ assignment.assigned_object_type }}: {{ assignment.assigned_object }}{% empty %}
{% trans "Not assigned yet" %}
{% endfor %}
- {% if object.attachments.all %}
Originaldateien
+ {% if object.attachments.all %}
{% trans "Original files" %}
{% for attachment in object.attachments.all %}{{ attachment.original_name }}{% endfor %}
{% endif %}
@@ -159,7 +160,7 @@ openButton.addEventListener('click', openViewer); closeButton.addEventListener('click', closeViewer); viewer.querySelectorAll('.documentation-content table').forEach(table => { - table.title = 'Tabelle in Großansicht öffnen'; + table.title = '{{ _("Open table in focus view")|escapejs }}'; table.addEventListener('click', event => { if (viewer.classList.contains('documentation-page-focus')) return; if (event.target.closest('a, button, input, select, textarea')) return; @@ -174,7 +175,7 @@ const copyButton = document.createElement('button'); copyButton.type = 'button'; copyButton.className = 'doc-code-copy'; - copyButton.innerHTML = ' Kopieren'; + copyButton.innerHTML = ' {{ _("Copy")|escapejs }}'; copyButton.addEventListener('click', async () => { const text = pre.innerText.trimEnd(); try { @@ -190,8 +191,8 @@ document.execCommand('copy'); area.remove(); } - copyButton.innerHTML = ' Kopiert'; - setTimeout(() => { copyButton.innerHTML = ' Kopieren'; }, 1500); + copyButton.innerHTML = ' {{ _("Copied")|escapejs }}'; + setTimeout(() => { copyButton.innerHTML = ' {{ _("Copy")|escapejs }}'; }, 1500); }); wrapper.appendChild(copyButton); if (pre.dataset.lang) { diff --git a/netbox_documentation/templates/netbox_documentation/document_archive.html b/netbox_documentation/templates/netbox_documentation/document_archive.html index 237ca81..069fc18 100644 --- a/netbox_documentation/templates/netbox_documentation/document_archive.html +++ b/netbox_documentation/templates/netbox_documentation/document_archive.html @@ -1,34 +1,35 @@ {% extends 'base/layout.html' %} +{% load i18n %} {% load form_helpers %} -{% block title %}Dokumentationsarchiv{% endblock %} +{% block title %}{% trans "Documentation archive" %}{% endblock %} {% block content %}
-
Dokumentationen exportieren
+
{% trans "Export documents" %}
-

Mehrere Ordner suchen und hinzufügen. Alle enthaltenen Dokumentationen werden gemeinsam mit Objektzuordnungen und Anhängen heruntergeladen.

+

{% trans "Search for and add several folders. All contained documents are downloaded together with their object assignments and attachments." %}

{% csrf_token %} {% render_form export_form %} - +
-
Dokumentationen importieren
+
{% trans "Import documents" %}
-

Ein zuvor mit diesem Plugin erzeugtes ZIP-Archiv hochladen. Nicht vorhandene NetBox-Zielobjekte werden sicher übersprungen.

+

{% trans "Upload a ZIP archive previously created with this plugin. Missing NetBox target objects are skipped safely." %}

{% csrf_token %} {% render_form import_form %} - +
diff --git a/netbox_documentation/templates/netbox_documentation/document_edit.html b/netbox_documentation/templates/netbox_documentation/document_edit.html index 2f86f61..a1208ad 100644 --- a/netbox_documentation/templates/netbox_documentation/document_edit.html +++ b/netbox_documentation/templates/netbox_documentation/document_edit.html @@ -1,4 +1,5 @@ {% extends 'generic/object_edit.html' %} +{% load i18n %} {% block javascript %} {{ block.super }}