Arthur Hanson 1 год назад
Родитель
Сommit
1eca1c3d17

+ 1 - 1
docs/plugins/development/forms.md

@@ -62,7 +62,7 @@ class MyModelImportForm(NetBoxModelImportForm):
     site = CSVModelChoiceField(
     site = CSVModelChoiceField(
         queryset=Site.objects.all(),
         queryset=Site.objects.all(),
         to_field_name='name',
         to_field_name='name',
-        help_text='Assigned site'
+        help_text=_('Assigned site')
     )
     )
 
 
     class Meta:
     class Meta:

+ 1 - 1
netbox/dcim/api/serializers.py

@@ -668,7 +668,7 @@ class DeviceSerializer(NetBoxModelSerializer):
     url = serializers.HyperlinkedIdentityField(view_name='dcim-api:device-detail')
     url = serializers.HyperlinkedIdentityField(view_name='dcim-api:device-detail')
     device_type = NestedDeviceTypeSerializer()
     device_type = NestedDeviceTypeSerializer()
     role = NestedDeviceRoleSerializer()
     role = NestedDeviceRoleSerializer()
-    device_role = NestedDeviceRoleSerializer(read_only=True, help_text='Deprecated in v3.6 in favor of `role`.')
+    device_role = NestedDeviceRoleSerializer(read_only=True, help_text=_('Deprecated in v3.6 in favor of `role`.'))
     tenant = NestedTenantSerializer(required=False, allow_null=True, default=None)
     tenant = NestedTenantSerializer(required=False, allow_null=True, default=None)
     platform = NestedPlatformSerializer(required=False, allow_null=True)
     platform = NestedPlatformSerializer(required=False, allow_null=True)
     site = NestedSiteSerializer()
     site = NestedSiteSerializer()

+ 2 - 2
netbox/dcim/forms/bulk_import.py

@@ -1373,14 +1373,14 @@ class VirtualDeviceContextImportForm(NetBoxModelImportForm):
         label=_('Device'),
         label=_('Device'),
         queryset=Device.objects.all(),
         queryset=Device.objects.all(),
         to_field_name='name',
         to_field_name='name',
-        help_text='Assigned role'
+        help_text=_('Assigned role')
     )
     )
     tenant = CSVModelChoiceField(
     tenant = CSVModelChoiceField(
         label=_('Tenant'),
         label=_('Tenant'),
         queryset=Tenant.objects.all(),
         queryset=Tenant.objects.all(),
         required=False,
         required=False,
         to_field_name='name',
         to_field_name='name',
-        help_text='Assigned tenant'
+        help_text=_('Assigned tenant')
     )
     )
     status = CSVChoiceField(
     status = CSVChoiceField(
         label=_('Status'),
         label=_('Status'),

+ 1 - 1
netbox/netbox/forms/base.py

@@ -78,7 +78,7 @@ class NetBoxModelImportForm(CSVModelForm, NetBoxModelForm):
         queryset=Tag.objects.all(),
         queryset=Tag.objects.all(),
         required=False,
         required=False,
         to_field_name='slug',
         to_field_name='slug',
-        help_text='Tag slugs separated by commas, encased with double quotes (e.g. "tag1,tag2,tag3")'
+        help_text=_('Tag slugs separated by commas, encased with double quotes (e.g. "tag1,tag2,tag3")')
     )
     )
 
 
     def _get_custom_fields(self, content_type):
     def _get_custom_fields(self, content_type):

+ 1 - 1
netbox/wireless/forms/bulk_import.py

@@ -42,7 +42,7 @@ class WirelessLANImportForm(NetBoxModelImportForm):
     status = CSVChoiceField(
     status = CSVChoiceField(
         label=_('Status'),
         label=_('Status'),
         choices=WirelessLANStatusChoices,
         choices=WirelessLANStatusChoices,
-        help_text='Operational status'
+        help_text=_('Operational status')
     )
     )
     vlan = CSVModelChoiceField(
     vlan = CSVModelChoiceField(
         label=_('VLAN'),
         label=_('VLAN'),