瀏覽代碼

[core] Improving usage of translations across all apps

abec 13 年之前
父節點
當前提交
6ab9d5d

+ 6 - 6
apps/beeswax/src/beeswax/templates/create_table_manually.mako

@@ -56,7 +56,7 @@ ${layout.menubar(section='tables')}
 	                    placeholder=_('table_name'),
 	                  )
 	                )}
-	                <span  class="help-inline error-inline hide">This field is required. Spaces are not allowed.</span>
+	                <span  class="help-inline error-inline hide">${_('This field is required. Spaces are not allowed.')}</span>
 	                <p class="help-block">
 	                    ${_('Name of the new table. Table names must be globally unique. Table names tend to correspond as well to the directory where the data will be stored.')}
 	                </p>
@@ -125,7 +125,7 @@ ${layout.menubar(section='tables')}
 	                ${comps.bootstrapLabel(table_form["field_terminator"])}
 	                <div class="controls">
 	                    ${comps.field(table_form["field_terminator"], render_default=True)}
-	                    <span  class="help-inline error-inline hide">This field is required. Spaces are not allowed.</span>
+	                    <span  class="help-inline error-inline hide">${_('This field is required. Spaces are not allowed.')}</span>
 	                    <span class="help-block">
 	                        ${_('Enter the column delimiter.  Must be a single character.  Use syntax like "\001" or "\t" for special characters.')}
 	                    </span>
@@ -135,7 +135,7 @@ ${layout.menubar(section='tables')}
 	                ${comps.bootstrapLabel(table_form["collection_terminator"])}
 	                <div class="controls">
 	                    ${comps.field(table_form["collection_terminator"], render_default=True)}
-	                    <span  class="help-inline error-inline hide">This field is required. Spaces are not allowed.</span>
+	                    <span  class="help-inline error-inline hide">${_('This field is required. Spaces are not allowed.')}</span>
 	                    <span class="help-block">
 	                        ${_('Use for array types.')}
 	                    </span>
@@ -145,7 +145,7 @@ ${layout.menubar(section='tables')}
 	                ${comps.bootstrapLabel(table_form["map_key_terminator"])}
 	                <div class="controls">
 	                    ${comps.field(table_form["map_key_terminator"], render_default=True)}
-	                    <span  class="help-inline error-inline hide">This field is required. Spaces are not allowed.</span>
+	                    <span  class="help-inline error-inline hide">${_('This field is required. Spaces are not allowed.')}</span>
 	                    <span class="help-block">
 	                        ${_('Use for map types.')}
 	                    </span>
@@ -209,7 +209,7 @@ ${layout.menubar(section='tables')}
 	                    placeholder='com.acme.data.MyInputFormat',
 	                    )
 	                    )}
-	                    <span  class="help-inline error-inline hide">This field is required. Spaces are not allowed.</span>
+	                    <span  class="help-inline error-inline hide">${_('This field is required. Spaces are not allowed.')}</span>
 	                    <span class="help-block">
 	                        ${_('Java Class used to read data')}
 	                    </span>
@@ -222,7 +222,7 @@ ${layout.menubar(section='tables')}
 	                    placeholder='com.acme.data.MyOutputFormat',
 	                    )
 	                    )}
-	                    <span  class="help-inline error-inline hide">This field is required. Spaces are not allowed.</span>
+	                    <span  class="help-inline error-inline hide">${_('This field is required. Spaces are not allowed.')}</span>
 	                    <span class="help-block">
 	                        ${_('Java Class used to write data')}
 	                    </span>

+ 1 - 1
apps/filebrowser/src/filebrowser/forms.py

@@ -97,7 +97,7 @@ class ChmodForm(forms.Form):
   path = PathField(label=_("Path to change permissions"))
 
   # By default, BooleanField only validates when
-  # it's checked.  Oy.
+  # it's checked.
   user_read = BooleanField(required=False)
   user_write = BooleanField(required=False)
   user_execute = BooleanField(required=False)

+ 2 - 2
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -102,7 +102,7 @@ from django.utils.translation import ugettext as _
     <table class="table table-condensed table-striped datatables">
         <thead>
             <tr>
-                <th class="sortable sorting" data-sort="type" width="5%">Type</th>
+                <th class="sortable sorting" data-sort="type" width="5%">${_('Type')}</th>
             % if cwd_set:
                 <th class="sortable sorting" data-sort="name">${_('Name')}</th>
             % else:
@@ -191,7 +191,7 @@ from django.utils.translation import ugettext as _
     ${pagination(page)}
     %else:
         <div class="alert">
-            There are no files matching the search criteria.
+            ${_('There are no files matching the search criteria.')}
         </div>
     %endif
 

+ 1 - 1
apps/jobbrowser/src/jobbrowser/templates/jobs.mako

@@ -50,7 +50,7 @@ ${commonheader(_('Job Browser'), "jobbrowser")}
             if retired == "on":
                 checked = 'checked="checked"'
         %>
-        <input name="retired" type="checkbox" class="submitter" ${checked}> Show retired jobs
+        <input name="retired" type="checkbox" class="submitter" ${checked}> ${_('Show retired jobs')}
     </label>
 
     <label class="pull-right">

+ 18 - 4
apps/jobsub/src/jobsub/forms.py

@@ -52,10 +52,16 @@ class JavaActionForm(forms.ModelForm):
     widgets = {
       'job_properties': forms.widgets.HiddenInput(),
       'files': forms.HiddenInput(),
-      'archives': forms.HiddenInput(),
-      'jar_path': forms.TextInput(attrs={'class': 'pathChooser'}),
+      'archives': forms.HiddenInput()
     }
 
+    name = forms.CharField(label=_('Name'))
+    description = forms.CharField(label=_('Description'))
+    main_class = forms.CharField(label=_('Main class'))
+    jar_path = forms.CharField(label=_('Jar path'), widget=forms.TextInput(attrs={'class': 'pathChooser'}))
+    args = forms.CharField(label=_('Args'))
+    java_opts = forms.CharField(label=_('Java opts'))
+
 
 class MapreduceActionForm(forms.ModelForm):
   """Used for specifying a mapreduce action"""
@@ -65,10 +71,15 @@ class MapreduceActionForm(forms.ModelForm):
     widgets = {
       'job_properties': forms.widgets.HiddenInput(),
       'files': forms.HiddenInput(),
-      'archives': forms.HiddenInput(),
-      'jar_path': forms.TextInput(attrs={'class': 'pathChooser'}),
+      'archives': forms.HiddenInput()
     }
 
+    name = forms.CharField(label=_('Name'))
+    description = forms.CharField(label=_('Description'))
+    jar_path = forms.CharField(label=_('Jar path'), widget=forms.TextInput(attrs={'class': 'pathChooser'}))
+    mapper = forms.CharField(label=_('Mapper'))
+    reducer = forms.CharField(label=_('Reducer'))
+
 
 class StreamingActionForm(forms.ModelForm):
   """Used for specifying a streaming action"""
@@ -81,6 +92,9 @@ class StreamingActionForm(forms.ModelForm):
       'archives': forms.widgets.HiddenInput(),
     }
 
+    name = forms.CharField(label=_('Name'))
+    description = forms.CharField(label=_('Description'))
+
 
 _ACTION_TYPE_TO_FORM_CLS = {
   models.OozieMapreduceAction.ACTION_TYPE: MapreduceActionForm,

+ 1 - 1
apps/useradmin/src/useradmin/templates/edit_user.mako

@@ -28,7 +28,7 @@ ${layout.menubar(section='users', _=_)}
   %if not field.is_hidden:
     <% group_class = len(field.errors) and "error" or "" %>
     <div class="control-group ${group_class}">
-      <label class="control-label" for="id_${field.html_name}">${field.label}</label>
+      <label class="control-label" for="id_${field.html_name}">${_(field.label)}</label>
       <div class="controls">
 		${unicode(field) | n}
         % if len(field.errors):

+ 1 - 1
apps/useradmin/src/useradmin/templates/list_groups.mako

@@ -34,7 +34,7 @@ ${layout.menubar(section='groups', _=_)}
             %endif
         </div>
         <form class="form-search">
-            ${_('Filter: ')}<input id="filterInput" class="input-xlarge search-query" placeholder="${_('Search for group name, members, etc...')}">
+            ${_('Filter: ')}<input id="filterInput" class="input-xxlarge search-query" placeholder="${_('Search for group name, members, etc...')}">
         </form>
     </div>
     <table class="table table-striped datatables">

+ 1 - 1
apps/useradmin/src/useradmin/templates/list_permissions.mako

@@ -29,7 +29,7 @@ ${layout.menubar(section='permissions', _=_)}
     <h1>${_('Hue Permissions')}</h1>
     <div class="well hueWell">
         <form class="form-search">
-                ${_('Filter: ')}<input id="filterInput" class="input-xlarge search-query" placeholder="${_('Search for application name, description, etc...')}">
+                ${_('Filter: ')}<input id="filterInput" class="input-xxlarge search-query" placeholder="${_('Search for application name, description, etc...')}">
         </form>
     </div>
     <table class="table table-striped datatables">

+ 1 - 1
apps/useradmin/src/useradmin/templates/list_users.mako

@@ -35,7 +35,7 @@ ${layout.menubar(section='users', _=_)}
             %endif
         </div>
         <form class="form-search">
-            ${_('Filter: ')}<input id="filterInput" class="input-xlarge search-query" placeholder="${_('Search for username, name, e-mail, etc...')}">
+            ${_('Filter: ')}<input id="filterInput" class="input-xxlarge search-query" placeholder="${_('Search for username, name, e-mail, etc...')}">
         </form>
     </div>
     <table class="table table-striped datatables">

+ 1 - 1
apps/useradmin/src/useradmin/views.py

@@ -116,7 +116,7 @@ class UserChangeForm(django.contrib.auth.forms.UserChangeForm):
       error_messages = {'invalid': _("Whitespaces and ':' not allowed") })
   password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput, required=False)
   password2 = forms.CharField(label=_("Password confirmation"), widget=forms.PasswordInput, required=False)
-  ensure_home_directory = forms.BooleanField(label=_("Create Home Directory"),
+  ensure_home_directory = forms.BooleanField(label=_("Create home directory"),
                                             help_text=_("Create home directory if one doesn't already exist."),
                                             initial=True,
                                             required=False)