Make hardcoded fields translatable

In Admin->Networks->[network name]->Ports->Create Port, the Device ID and
Device owner have untranslated help_text values, which get displayed as
tool tips in the UI.  This change adds the translation function to those
pieces of text.  Also fixing the Edit Port parts as well.

Change-Id: Iaddd58b50cda818e332f8bead5a02b07916a2f58
Closes-Bug: #1271348
This commit is contained in:
Doug Fish 2014-01-22 09:11:36 -06:00
parent 6a52b59c29
commit 7ce85bc391

View File

@ -44,11 +44,12 @@ class CreatePort(forms.SelfHandlingForm):
admin_state = forms.BooleanField(label=_("Admin State"),
initial=True, required=False)
device_id = forms.CharField(max_length=100, label=_("Device ID"),
help_text='Device ID attached to the port',
help_text=_("Device ID attached to the port"),
required=False)
device_owner = forms.CharField(max_length=100, label=_("Device Owner"),
help_text='Device owner attached to the port',
required=False)
help_text=_("Device owner attached to the "
"port"),
required=False)
def handle(self, request, data):
try:
@ -77,11 +78,12 @@ class CreatePort(forms.SelfHandlingForm):
class UpdatePort(project_forms.UpdatePort):
#tenant_id = forms.CharField(widget=forms.HiddenInput())
device_id = forms.CharField(max_length=100, label=_("Device ID"),
help_text='Device ID attached to the port',
help_text=_("Device ID attached to the port"),
required=False)
device_owner = forms.CharField(max_length=100, label=_("Device Owner"),
help_text='Device owner attached to the port',
required=False)
help_text=_("Device owner attached to the "
"port"),
required=False)
failure_url = 'horizon:admin:networks:detail'
def handle(self, request, data):