Add i18n trans for form field label and help_text

Add i18n trans for form field label and help_text.

Change-Id: I44e418171e383f5f3c62c5693b2d5bf0ad742a75
This commit is contained in:
zhurong 2016-03-23 08:48:50 +00:00
parent a43ddd955a
commit f3c29dbbe8
4 changed files with 8 additions and 8 deletions

View File

@ -22,9 +22,9 @@ from muranodashboard import api
class AddCategoryForm(horizon_forms.SelfHandlingForm):
name = forms.CharField(label='Category Name',
name = forms.CharField(label=_('Category Name'),
max_length=80,
help_text='80 characters max.')
help_text=_('80 characters max.'))
def handle(self, request, data):
if data:

View File

@ -30,7 +30,7 @@ ENV_NAME_HELP_TEXT = _("Environment name must contain at least one "
class CreateEnvironmentForm(horizon_forms.SelfHandlingForm):
name = forms.CharField(label="Environment Name",
name = forms.CharField(label=_("Environment Name"),
help_text=ENV_NAME_HELP_TEXT,
max_length=255,
required=True)

View File

@ -53,9 +53,9 @@ class MarkImageForm(horizon_forms.SelfHandlingForm):
'cirros.demo': 'CirrOS for Murano Demo'
}
image = forms.ChoiceField(label='Image')
image = forms.ChoiceField(label=_('Image'))
title = forms.CharField(max_length="255", label=_("Title"))
type = forms.ChoiceField(label="Type", choices=_metadata.items())
type = forms.ChoiceField(label=_("Type"), choices=_metadata.items())
existing_titles = forms.CharField(widget=forms.HiddenInput)
def __init__(self, request, *args, **kwargs):

View File

@ -161,11 +161,11 @@ class ImportPackageForm(forms.Form):
class PackageParamsMixin(forms.Form):
name = forms.CharField(label=_('Name'),
max_length=80,
help_text='80 characters max.')
help_text=_('80 characters max.'))
tags = forms.CharField(label=_('Tags'),
required=False,
help_text='Provide comma-separated list of words,'
' associated with the package')
help_text=_('Provide comma-separated list of words,'
' associated with the package'))
is_public = forms.BooleanField(label=_('Public'),
required=False,
widget=forms.CheckboxInput)