From dba958db0603f626272d402f6f6117c0f2b058ff Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Fri, 4 Oct 2024 16:58:58 -0500 Subject: [PATCH] Add translation strings --- netbox_lifecycle/tables/contract.py | 25 +++++++++++++------------ netbox_lifecycle/tables/license.py | 7 ++++++- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/netbox_lifecycle/tables/contract.py b/netbox_lifecycle/tables/contract.py index 62167c4..eff816f 100644 --- a/netbox_lifecycle/tables/contract.py +++ b/netbox_lifecycle/tables/contract.py @@ -16,7 +16,7 @@ class VendorTable(NetBoxTable): name = tables.Column( linkify=True, - verbose_name='Name' + verbose_name=_('Name') ) class Meta(NetBoxTable.Meta): @@ -44,7 +44,7 @@ class Meta(NetBoxTable.Meta): class SupportContractTable(NetBoxTable): contract_id = tables.Column( linkify=True, - verbose_name='Contract ID' + verbose_name=_('Contract ID') ) class Meta(NetBoxTable.Meta): @@ -59,51 +59,52 @@ class Meta(NetBoxTable.Meta): class SupportContractAssignmentTable(NetBoxTable): contract = tables.Column( - linkify=True + verbose_name=_('Contract'), + linkify=True, ) sku = tables.Column( - verbose_name='SKU', + verbose_name=_('SKU'), linkify=True, ) device_name = tables.Column( - verbose_name='Device Name', + verbose_name=_('Device Name'), accessor='device__name', linkify=False, orderable=True, ) device_serial = tables.Column( - verbose_name='Serial Number', + verbose_name=_('Serial Number'), accessor='device__serial', orderable=True, ) device_model = tables.Column( - verbose_name='Device Model', + verbose_name=_('Device Model'), accessor='device__device_type__model', linkify=False, orderable=True, ) device_status = ChoiceFieldColumn( - verbose_name='Device Status', + verbose_name=_('Device Status'), accessor='device__status', orderable=True, ) license_name = tables.Column( - verbose_name='License', + verbose_name=_('License'), accessor='license__license__name', linkify=False, orderable=True, ) quantity = tables.Column( - verbose_name='License Quantity', + verbose_name=_('License Quantity'), accessor='license__quantity', orderable=False, ) renewal = tables.Column( - verbose_name='Renewal Date', + verbose_name=_('Renewal Date'), accessor='contract__renewal', ) end = tables.Column( - verbose_name='End Date', + verbose_name=_('End Date'), accessor='end_date', orderable=False, ) diff --git a/netbox_lifecycle/tables/license.py b/netbox_lifecycle/tables/license.py index 5937658..b80aaf5 100644 --- a/netbox_lifecycle/tables/license.py +++ b/netbox_lifecycle/tables/license.py @@ -1,3 +1,4 @@ +from django.utils.translation import gettext as _ import django_tables2 as tables from netbox.tables import NetBoxTable @@ -12,10 +13,11 @@ class LicenseTable(NetBoxTable): name = tables.Column( + verbose_name=_('Name'), linkify=True, - verbose_name='Name' ) manufacturer = tables.Column( + verbose_name=_('Manufacturer'), linkify=True ) @@ -31,12 +33,15 @@ class Meta(NetBoxTable.Meta): class LicenseAssignmentTable(NetBoxTable): license = tables.Column( + verbose_name=_('License'), linkify=True ) vendor = tables.Column( + verbose_name=_('Vendor'), linkify=True ) device = tables.Column( + verbose_name=_('Device'), linkify=True )