mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
10300 initial translation support use gettext
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
from django import forms
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
from dcim.choices import InterfaceModeChoices
|
||||
from dcim.constants import INTERFACE_MTU_MAX, INTERFACE_MTU_MIN
|
||||
@ -90,7 +91,7 @@ class ClusterBulkEditForm(NetBoxModelBulkEditForm):
|
||||
)
|
||||
comments = CommentField(
|
||||
widget=SmallTextarea,
|
||||
label='Comments'
|
||||
label=_('Comments')
|
||||
)
|
||||
|
||||
model = Cluster
|
||||
@ -147,15 +148,15 @@ class VirtualMachineBulkEditForm(NetBoxModelBulkEditForm):
|
||||
)
|
||||
vcpus = forms.IntegerField(
|
||||
required=False,
|
||||
label='vCPUs'
|
||||
label=_('vCPUs')
|
||||
)
|
||||
memory = forms.IntegerField(
|
||||
required=False,
|
||||
label='Memory (MB)'
|
||||
label=_('Memory (MB)')
|
||||
)
|
||||
disk = forms.IntegerField(
|
||||
required=False,
|
||||
label='Disk (GB)'
|
||||
label=_('Disk (GB)')
|
||||
)
|
||||
description = forms.CharField(
|
||||
max_length=200,
|
||||
@ -163,7 +164,7 @@ class VirtualMachineBulkEditForm(NetBoxModelBulkEditForm):
|
||||
)
|
||||
comments = CommentField(
|
||||
widget=SmallTextarea,
|
||||
label='Comments'
|
||||
label=_('Comments')
|
||||
)
|
||||
|
||||
model = VirtualMachine
|
||||
@ -199,7 +200,7 @@ class VMInterfaceBulkEditForm(NetBoxModelBulkEditForm):
|
||||
required=False,
|
||||
min_value=INTERFACE_MTU_MIN,
|
||||
max_value=INTERFACE_MTU_MAX,
|
||||
label='MTU'
|
||||
label=_('MTU')
|
||||
)
|
||||
description = forms.CharField(
|
||||
max_length=100,
|
||||
@ -213,7 +214,7 @@ class VMInterfaceBulkEditForm(NetBoxModelBulkEditForm):
|
||||
vlan_group = DynamicModelChoiceField(
|
||||
queryset=VLANGroup.objects.all(),
|
||||
required=False,
|
||||
label='VLAN group'
|
||||
label=_('VLAN group')
|
||||
)
|
||||
untagged_vlan = DynamicModelChoiceField(
|
||||
queryset=VLAN.objects.all(),
|
||||
@ -221,7 +222,7 @@ class VMInterfaceBulkEditForm(NetBoxModelBulkEditForm):
|
||||
query_params={
|
||||
'group_id': '$vlan_group',
|
||||
},
|
||||
label='Untagged VLAN'
|
||||
label=_('Untagged VLAN')
|
||||
)
|
||||
tagged_vlans = DynamicModelMultipleChoiceField(
|
||||
queryset=VLAN.objects.all(),
|
||||
@ -229,12 +230,12 @@ class VMInterfaceBulkEditForm(NetBoxModelBulkEditForm):
|
||||
query_params={
|
||||
'group_id': '$vlan_group',
|
||||
},
|
||||
label='Tagged VLANs'
|
||||
label=_('Tagged VLANs')
|
||||
)
|
||||
vrf = DynamicModelChoiceField(
|
||||
queryset=VRF.objects.all(),
|
||||
required=False,
|
||||
label='VRF'
|
||||
label=_('VRF')
|
||||
)
|
||||
|
||||
model = VMInterface
|
||||
|
Reference in New Issue
Block a user