浏览代码

HUE-763 [jobsub] Templates internationalization

Created message bundles for all the templates
Inlined i18n variables
Enrico Berti 13 年之前
父节点
当前提交
1435746e9c

+ 1 - 4
apps/jobsub/babel.cfg

@@ -1,5 +1,2 @@
 [python: src/jobsub/**.py]
-[django: src/jobsub/templates/**.html]
-
-[extractors]
-django = babeldjango.extract:extract_django
+[mako: src/jobsub/templates/**.mako]

+ 259 - 3
apps/jobsub/src/jobsub/locale/django.pot

@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2012-01-27 15:00+0100\n"
+"POT-Creation-Date: 2012-06-30 02:05+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,7 +17,263 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Generated-By: Babel 0.9.6\n"
 
-#: src/jobsub/templates/layout.html:74
-msgid "'Shell'"
+#: src/jobsub/templates/edit_design.mako:26
+#: src/jobsub/templates/list_designs.mako:28
+#: src/jobsub/templates/list_history.mako:26
+msgid "Job Designer"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:55
+#, python-format
+msgid "Job Design (%(type)s type)"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:69
+msgid "You can parametrize the values, using"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:69
+msgid "or"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:71
+msgid ""
+"When the design is submitted, you will be prompted for the actual value "
+"of "
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:79
+msgid "Job Properties"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:85
+msgid "Property name"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:86
+msgid "Value"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:94
+#: src/jobsub/templates/edit_design.mako:119
+#: src/jobsub/templates/edit_design.mako:142
+#: src/jobsub/templates/list_designs.mako:91
+msgid "Delete"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:106
+msgid "Add Property"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:111
+msgid "Files"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:129
+msgid "Add File"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:134
+msgid "Archives"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:152
+msgid "Add Archive"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:159
+msgid "Save"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:160
+#: src/jobsub/templates/list_designs.mako:120
+msgid "Cancel"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:170
+msgid "Choose a file"
+msgstr ""
+
+#: src/jobsub/templates/layout.mako:32
+msgid "Designs"
+msgstr ""
+
+#: src/jobsub/templates/layout.mako:33
+msgid "History"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:34
+msgid "Job Designs"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:37
+msgid "Create Mapreduce Design"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:38
+msgid "Create Streaming Design"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:39
+msgid "Create Java Design"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:41
+msgid "Install Samples"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:46
+#: src/jobsub/templates/list_history.mako:35
+msgid "Filter: "
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:46
+#: src/jobsub/templates/list_history.mako:35
+msgid "Search for username, name, etc..."
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:53
+#: src/jobsub/templates/list_history.mako:44
+msgid "Owner"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:54
+#: src/jobsub/templates/list_history.mako:45
+msgid "Name"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:55
+#: src/jobsub/templates/list_history.mako:46
+msgid "Type"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:56
+#: src/jobsub/templates/list_history.mako:47
+msgid "Description"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:57
+msgid "Last Modified"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:72
+#, python-format
+msgid "Submit %(name)s to the cluster"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:73
+#, python-format
+msgid "Edit %(name)s"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:79
+#: src/jobsub/templates/list_designs.mako:119
+msgid "Submit"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:81
+msgid "Edit"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:85
+#, python-format
+msgid "Delete %(name)s"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:86
+#, python-format
+msgid "Are you sure you want to delete %(name)s?"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:94
+#, python-format
+msgid "Clone %(name)s"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:96
+msgid "Clone"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:110
+msgid "Submit this design?"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:129
+msgid "Delete this design?"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:132
+#: src/jobsub/templates/list_designs.mako:148
+msgid "Yes"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:133
+#: src/jobsub/templates/list_designs.mako:149
+msgid "No"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:142
+msgid "Install sample job designs?"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:145
+msgid "It will take a few seconds to install."
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:218
+#: src/jobsub/templates/list_history.mako:83
+msgid "No data available in table"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:219
+#: src/jobsub/templates/list_history.mako:84
+msgid "Showing _START_ to _END_ of _TOTAL_ entries"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:220
+#: src/jobsub/templates/list_history.mako:85
+msgid "Showing 0 to 0 of 0 entries"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:221
+#: src/jobsub/templates/list_history.mako:86
+msgid "(filtered from _MAX_ total entries)"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:222
+#: src/jobsub/templates/list_history.mako:87
+msgid "No matching records found"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:224
+#: src/jobsub/templates/list_history.mako:89
+msgid "First"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:225
+#: src/jobsub/templates/list_history.mako:90
+msgid "Last"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:226
+#: src/jobsub/templates/list_history.mako:91
+msgid "Next"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:227
+#: src/jobsub/templates/list_history.mako:92
+msgid "Previous"
+msgstr ""
+
+#: src/jobsub/templates/list_history.mako:32
+msgid "Job Submission History"
+msgstr ""
+
+#: src/jobsub/templates/list_history.mako:43
+msgid "Oozie Job ID"
+msgstr ""
+
+#: src/jobsub/templates/list_history.mako:48
+msgid "Submission Date"
 msgstr ""
 

二进制
apps/jobsub/src/jobsub/locale/en_US/LC_MESSAGES/django.mo


+ 0 - 23
apps/jobsub/src/jobsub/locale/en_US/LC_MESSAGES/django.po

@@ -1,23 +0,0 @@
-# English (United States) translations for PROJECT.
-# Copyright (C) 2012 ORGANIZATION
-# This file is distributed under the same license as the PROJECT project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2012-01-27 15:00+0100\n"
-"PO-Revision-Date: 2012-01-27 15:00+0100\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: en_US <LL@li.org>\n"
-"Plural-Forms: nplurals=2; plural=(n != 1)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.6\n"
-
-#: src/jobsub/templates/layout.html:74
-msgid "'Shella'"
-msgstr ""
-

二进制
apps/jobsub/src/jobsub/locale/it/LC_MESSAGES/django.mo


+ 0 - 23
apps/jobsub/src/jobsub/locale/it/LC_MESSAGES/django.po

@@ -1,23 +0,0 @@
-# Italian translations for PROJECT.
-# Copyright (C) 2012 ORGANIZATION
-# This file is distributed under the same license as the PROJECT project.
-# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PROJECT VERSION\n"
-"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2012-01-27 15:00+0100\n"
-"PO-Revision-Date: 2012-01-27 15:00+0100\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: it <LL@li.org>\n"
-"Plural-Forms: nplurals=2; plural=(n != 1)\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.6\n"
-
-#: src/jobsub/templates/layout.html:74
-msgid "'Terminale'"
-msgstr ""
-

+ 24 - 27
apps/jobsub/src/jobsub/templates/edit_design.mako

@@ -15,19 +15,16 @@
 ## limitations under the License.
 
 <%!
-  import urllib
-
-  from desktop.views import commonheader, commonfooter
-  from django.utils.translation import ugettext, ungettext, get_language, activate
-  from desktop.lib.django_util import extract_field_data
-
-  _ = ugettext
+import urllib
+from desktop.views import commonheader, commonfooter
+from desktop.lib.django_util import extract_field_data
+from django.utils.translation import ugettext as _
 %>
 
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader("Job Designer", "jobsub", "100px")}
-${layout.menubar(section='designs')}
+${commonheader(_('Job Designer'), "jobsub", "100px")}
+${layout.menubar(section='designs', _=_)}
 
 
 
@@ -54,7 +51,7 @@ ${layout.menubar(section='designs')}
 </%def>
 
 <div class="container-fluid">
-  <h1>Job Design (${_(action_type)} type)</h1>
+  <h1>${_('Job Design (%(type)s type)') % dict(type=action_type)}</h1>
 
   <form class="form-horizontal" id="workflowForm" action="${urllib.quote(action)}" method="POST">
     <fieldset>
@@ -66,9 +63,9 @@ ${layout.menubar(section='designs')}
         <hr/>
         <div class="control-group">
           <p class="alert alert-info">
-              You can parameterize the values, using <code>$myVar</code> or
-              <code>${"${"}myVar}</code>. When the design is submitted, you will be
-              prompted for the actual value of <code>myVar</code>.
+              ${_('You can parametrize the values, using')} <code>$myVar</code> ${_('or')}
+              <code>${"${"}myVar}</code> .
+              ${_('When the design is submitted, you will be prompted for the actual value of ')}<code>myVar</code> .
           </p>
         </div>
         % for field in form.action:
@@ -76,14 +73,14 @@ ${layout.menubar(section='designs')}
         % endfor
 
         <div class="control-group">
-            <label class="control-label">Job Properties</label>
+            <label class="control-label">${_('Job Properties')}</label>
             <div class="controls">
                 ## Data bind for job properties
                 <table class="table-condensed designTable" data-bind="visible: properties().length > 0">
                   <thead>
                     <tr>
-                      <th>Property name</th>
-                      <th>Value</th>
+                      <th>${_('Property name')}</th>
+                      <th>${_('Value')}</th>
                       <th />
                     </tr>
                   </thead>
@@ -91,7 +88,7 @@ ${layout.menubar(section='designs')}
                     <tr>
                       <td><input class="span3 required propKey" data-bind="value: name, uniqueName: false" /></td>
                       <td><input class="span4 required pathChooserKo" data-bind="fileChooser: $data, value: value, uniqueName: false" /></td>
-                      <td><a class="btn btn-small" href="#" data-bind="click: $root.removeProp">Delete</a></td>
+                      <td><a class="btn btn-small" href="#" data-bind="click: $root.removeProp">${_('Delete')}</a></td>
                     </tr>
                   </tbody>
                 </table>
@@ -103,12 +100,12 @@ ${layout.menubar(section='designs')}
                   </div>
                 % endif
 
-                <button class="btn" data-bind="click: addProp">Add Property</button>
+                <button class="btn" data-bind="click: addProp">${_('Add Property')}</button>
             </div>
         </div>
 
         <div class="control-group">
-            <label class="control-label">Files</label>
+            <label class="control-label">${_('Files')}</label>
             <div class="controls">
                 ## Data bind for files (distributed cache)
                 <table class="table-condensed designTable" data-bind="visible: files().length > 0">
@@ -116,7 +113,7 @@ ${layout.menubar(section='designs')}
                     <tr>
                       <td><input class="input span5 required pathChooserKo"
                                 data-bind="fileChooser: $data, value: name, uniqueName: false" /></td>
-                      <td><a class="btn" href="#" data-bind="click: $root.removeFile">Delete</a></td>
+                      <td><a class="btn" href="#" data-bind="click: $root.removeFile">${_('Delete')}</a></td>
                     </tr>
                   </tbody>
                 </table>
@@ -126,12 +123,12 @@ ${layout.menubar(section='designs')}
                     </div>
                 % endif
 
-                <button class="btn" data-bind="click: addFile">Add File</button>
+                <button class="btn" data-bind="click: addFile">${_('Add File')}</button>
             </div>
         </div>
 
         <div class="control-group">
-            <label class="control-label">Archives</label>
+            <label class="control-label">${_('Archives')}</label>
             <div class="controls">
                 ## Data bind for archives (distributed cache)
                 <table class="table-condensed designTable" data-bind="visible: archives().length > 0">
@@ -139,7 +136,7 @@ ${layout.menubar(section='designs')}
                     <tr>
                       <td><input class="input span5 required pathChooserKo"
                                 data-bind="fileChooser: $data, value: name, uniqueName: false" /></td>
-                      <td><a class="btn" href="#" data-bind="click: $root.removeArchive">Delete</a></td>
+                      <td><a class="btn" href="#" data-bind="click: $root.removeArchive">${_('Delete')}</a></td>
                     </tr>
                   </tbody>
                 </table>
@@ -149,15 +146,15 @@ ${layout.menubar(section='designs')}
                     </div>
                 % endif
 
-                <button class="btn" data-bind="click: addArchive">Add Archive</button>
+                <button class="btn" data-bind="click: addArchive">${_('Add Archive')}</button>
             </div>
         </div>
     </fieldset>
 
     ## Submit
     <div class="form-actions">
-      <button data-bind="click: submit" class="btn btn-primary">Save</button>
-      <a href="/jobsub" class="btn">Cancel</a>
+      <button data-bind="click: submit" class="btn btn-primary">${_('Save')}</button>
+      <a href="/jobsub" class="btn">${_('Cancel')}</a>
     </div>
   </form>
 
@@ -167,7 +164,7 @@ ${layout.menubar(section='designs')}
 <div id="chooseFile" class="modal hide fade">
     <div class="modal-header">
         <a href="#" class="close" data-dismiss="modal">&times;</a>
-        <h3>Choose a file</h3>
+        <h3>${_('Choose a file')}</h3>
     </div>
     <div class="modal-body">
         <div id="fileChooserModal">

+ 3 - 3
apps/jobsub/src/jobsub/templates/layout.mako

@@ -25,12 +25,12 @@ def is_selected(section, matcher):
     return ""
 %>
 
-<%def name="menubar(section='')">
+<%def name="menubar(section='', _=None)">
 	<div class="subnav subnav-fixed">
 		<div class="container-fluid">
 			<ul class="nav nav-pills">
-				<li class="${is_selected(section, 'designs')}"><a href="${url('jobsub.views.list_designs')}">Designs</a></li>
-				<li class="${is_selected(section, 'history')}"><a href="${url('jobsub.views.list_history')}">History</a></li>
+				<li class="${is_selected(section, 'designs')}"><a href="${url('jobsub.views.list_designs')}">${_('Designs')}</a></li>
+				<li class="${is_selected(section, 'history')}"><a href="${url('jobsub.views.list_history')}">${_('History')}</a></li>
 			</ul>
 		</div>
 	</div>

+ 55 - 41
apps/jobsub/src/jobsub/templates/list_designs.mako

@@ -15,45 +15,46 @@
 ## limitations under the License.
 
 <%!
-    import cgi
-    import urllib
-    import time as py_time
-    from django.template.defaultfilters import date, time
-    from desktop.lib.django_util import extract_field_data
-    from desktop.views import commonheader, commonfooter
+import cgi
+import urllib
+import time as py_time
+from django.template.defaultfilters import date, time
+from desktop.lib.django_util import extract_field_data
+from desktop.views import commonheader, commonfooter
+from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader("Job Designer", "jobsub", "100px")}
-${layout.menubar(section='designs')}
+${commonheader(_('Job Designer'), "jobsub", "100px")}
+${layout.menubar(section='designs', _=_)}
 
 <script src="/static/ext/js/datatables-paging-0.1.js" type="text/javascript" charset="utf-8"></script>
 
 <div class="container-fluid">
-    <h1>Job Designs</h1>
+    <h1>${_('Job Designs')}</h1>
     <div class="well hueWell">
         <div class="btn-group pull-right">
-            <a href="${ url('jobsub.views.new_design', action_type='mapreduce') }" class="btn">Create Mapreduce Design</a>
-            <a href="${ url('jobsub.views.new_design', action_type='streaming') }" class="btn">Create Streaming Design</a>
-            <a href="${ url('jobsub.views.new_design', action_type='java') }" class="btn">Create Java Design</a>
+            <a href="${ url('jobsub.views.new_design', action_type='mapreduce') }" class="btn">${_('Create Mapreduce Design')}</a>
+            <a href="${ url('jobsub.views.new_design', action_type='streaming') }" class="btn">${_('Create Streaming Design')}</a>
+            <a href="${ url('jobsub.views.new_design', action_type='java') }" class="btn">${_('Create Java Design')}</a>
             %if show_install_examples:
-                    <a id="installSamplesLink" href="javascript:void(0)" data-confirmation-url="${url('jobsub.views.setup')}" class="btn" >Install Samples</a>
+                    <a id="installSamplesLink" href="javascript:void(0)" data-confirmation-url="${url('jobsub.views.setup')}" class="btn" >${_('Install Samples')}</a>
             %endif
         </div>
 
         <form class="form-search">
-            Filter: <input id="filterInput" class="input-xlarge search-query" placeholder="Search for username, name, etc...">
+            ${_('Filter: ')}<input id="filterInput" class="input-xlarge search-query" placeholder="${_('Search for username, name, etc...')}">
         </form>
     </div>
 
     <table id="designTable" class="table table-condensed datatables">
         <thead>
         <tr>
-            <th>Owner</th>
-            <th>Name</th>
-            <th>Type</th>
-            <th>Description</th>
-            <th>Last Modified</th>
+            <th>${_('Owner')}</th>
+            <th>${_('Name')}</th>
+            <th>${_('Type')}</th>
+            <th>${_('Description')}</th>
+            <th>${_('Last Modified')}</th>
             <th nowrap="nowrap">&nbsp;</th>
         </tr>
         </thead>
@@ -67,21 +68,21 @@ ${layout.menubar(section='designs')}
                     <td nowrap="nowrap"><span alt="${py_time.mktime(design.last_modified.timetuple())}">${date(design.last_modified)} ${time(design.last_modified).replace("p.m.","PM").replace("a.m.","AM")}</span></td>
                 <td nowrap="nowrap" class="right">
                 %if currentuser.username == design.owner.username:
-                    <a title="Submit ${design.name}" class="btn small submitConfirmation"
-                       alt="Submit ${design.name} to the cluster"
+                    <a title="${_('Submit %(name)s to the cluster') % dict(name=design.name)}" class="btn small submitConfirmation"
+                       alt="${_('Submit %(name)s to the cluster') % dict(name=design.name)}"
                        href="javascript:void(0)"
                        data-param-url="${ url('jobsub.views.get_design_params', design_id=design.id) }"
-                       data-submit-url="${ url('jobsub.views.submit_design', design_id=design.id) }">Submit</a>
-                    <a title="Edit ${design.name}" class="btn small"
-                       href="${ url('jobsub.views.edit_design', design_id=design.id) }" data-row-selector="true">Edit</a>
-                    %endif%
+                       data-submit-url="${ url('jobsub.views.submit_design', design_id=design.id) }">${_('Submit')}</a>
+                    <a title="${_('Edit %(name)s') % dict(name=design.name)}" class="btn small"
+                       href="${ url('jobsub.views.edit_design', design_id=design.id) }" data-row-selector="true">${_('Edit')}</a>
+                %endif
                 %if currentuser.is_superuser or currentuser.username == design.owner.username:
-                        <a title="Delete ${design.name}" class="btn small deleteConfirmation"
-                           alt="Are you sure you want to delete ${design.name}?"
-                           href="javascript:void(0)"
-                           data-confirmation-url="${ url('jobsub.views.delete_design', design_id=design.id) }">Delete</a>
+                    <a title="${_('Delete %(name)s') % dict(name=design.name)}" class="btn small deleteConfirmation"
+                       alt="${_('Are you sure you want to delete %(name)s?') % dict(name=design.name)}"
+                       href="javascript:void(0)"
+                       data-confirmation-url="${ url('jobsub.views.delete_design', design_id=design.id) }">${_('Delete')}</a>
                 %endif
-                    <a title="Clone ${design.name}" class="btn small" href="${ url('jobsub.views.clone_design', design_id=design.id) }">Clone</a>
+                    <a title="${_('Clone %(name)s') % dict(name=design.name)}" class="btn small" href="${ url('jobsub.views.clone_design', design_id=design.id) }">${_('Clone')}</a>
                 </td>
                 </tr>
                 %endfor
@@ -95,7 +96,7 @@ ${layout.menubar(section='designs')}
     <form id="submitWfForm" action="" method="POST">
         <div class="modal-header">
             <a href="#" class="close" data-dismiss="modal">&times;</a>
-            <h3 id="submitWfMessage">Submit this design?</h3>
+            <h3 id="submitWfMessage">${_('Submit this design?')}</h3>
         </div>
         <div class="modal-body">
             <fieldset>
@@ -104,8 +105,8 @@ ${layout.menubar(section='designs')}
             </fieldset>
         </div>
         <div class="modal-footer">
-            <input id="submitBtn" type="submit" class="btn primary" value="Submit"/>
-            <a href="#" class="btn secondary hideModal">Cancel</a>
+            <input id="submitBtn" type="submit" class="btn primary" value="${_('Submit')}"/>
+            <a href="#" class="btn secondary hideModal">${_('Cancel')}</a>
         </div>
     </form>
 </div>
@@ -114,11 +115,11 @@ ${layout.menubar(section='designs')}
     <form id="deleteWfForm" action="" method="POST">
         <div class="modal-header">
             <a href="#" class="close" data-dismiss="modal">&times;</a>
-            <h3 id="deleteWfMessage">Delete this design?</h3>
+            <h3 id="deleteWfMessage">${_('Delete this design?')}</h3>
         </div>
         <div class="modal-footer">
-            <input type="submit" class="btn primary" value="Yes"/>
-            <a href="#" class="btn secondary hideModal">No</a>
+            <input type="submit" class="btn primary" value="${_('Yes')}"/>
+            <a href="#" class="btn secondary hideModal">${_('No')}</a>
         </div>
     </form>
 </div>
@@ -127,14 +128,14 @@ ${layout.menubar(section='designs')}
     <form id="installSamplesForm" action="${url('jobsub.views.setup')}" method="POST">
         <div class="modal-header">
             <a href="#" class="close" data-dismiss="modal">&times;</a>
-            <h3>Install sample job designs?</h3>
+            <h3>${_('Install sample job designs?')}</h3>
         </div>
         <div class="modal-body">
-            It will take a few seconds to install.
+            ${_('It will take a few seconds to install.')}
         </div>
         <div class="modal-footer">
-            <input type="submit" class="btn primary" value="Yes"/>
-            <a href="#" class="btn secondary" data-dismiss="modal">No</a>
+            <input type="submit" class="btn primary" value="${_('Yes')}"/>
+            <a href="#" class="btn secondary" data-dismiss="modal">${_('No')}</a>
         </div>
     </form>
 </div>
@@ -201,7 +202,20 @@ ${layout.menubar(section='designs')}
                 { "sType": "alt-numeric" },
                 { "bSortable": false }
             ],
-            "aaSorting": [[ 4, "desc" ]]
+            "aaSorting": [[ 4, "desc" ]],
+            "oLanguage": {
+                "sEmptyTable":     "${_('No data available in table')}",
+                "sInfo":           "${_('Showing _START_ to _END_ of _TOTAL_ entries')}",
+                "sInfoEmpty":      "${_('Showing 0 to 0 of 0 entries')}",
+                "sInfoFiltered":   "${_('(filtered from _MAX_ total entries)')}",
+                "sZeroRecords":    "${_('No matching records found')}",
+                "oPaginate": {
+                    "sFirst":    "${_('First')}",
+                    "sLast":     "${_('Last')}",
+                    "sNext":     "${_('Next')}",
+                    "sPrevious": "${_('Previous')}"
+                }
+            }
         });
 
         $("#filterInput").keyup(function() {

+ 29 - 18
apps/jobsub/src/jobsub/templates/list_history.mako

@@ -15,26 +15,24 @@
 ## limitations under the License.
 
 <%!
-    import urllib
-    import time as py_time
-    from django.template.defaultfilters import date, time
-    from desktop.views import commonheader, commonfooter
-    from django.utils.translation import ugettext, ungettext, get_language, activate
-
-    _ = ugettext
+import urllib
+import time as py_time
+from django.template.defaultfilters import date, time
+from desktop.views import commonheader, commonfooter
+from django.utils.translation import ugettext as _
 %>
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader("Job Designer", "jobsub", "100px")}
-${layout.menubar(section='history')}
+${commonheader(_('Job Designer'), "jobsub", "100px")}
+${layout.menubar(section='history', _=_)}
 
 <script src="/static/ext/js/datatables-paging-0.1.js" type="text/javascript" charset="utf-8"></script>
 
 <div class="container-fluid">
-    <h1>Job Submission History</h1>
+    <h1>${_('Job Submission History')}</h1>
     <div class="well hueWell">
         <form class="form-search">
-            Filter: <input id="filterInput" class="input-xlarge search-query" placeholder="Search for username, name, etc...">
+            ${_('Filter: ')}<input id="filterInput" class="input-xlarge search-query" placeholder="${_('Search for username, name, etc...')}">
         </form>
     </div>
 
@@ -42,12 +40,12 @@ ${layout.menubar(section='history')}
     <table class="table table-condensed datatables" id="jobTable">
         <thead>
         <tr>
-            <th>Oozie Job ID</th>
-            <th>Owner</th>
-            <th>Name</th>
-            <th>Type</th>
-            <th>Description</th>
-            <th>Submission Date</th>
+            <th>${_('Oozie Job ID')}</th>
+            <th>${_('Owner')}</th>
+            <th>${_('Name')}</th>
+            <th>${_('Type')}</th>
+            <th>${_('Description')}</th>
+            <th>${_('Submission Date')}</th>
         </tr>
         </thead>
         <tbody>
@@ -80,7 +78,20 @@ ${layout.menubar(section='history')}
                 null,
                 { "sType": "alt-numeric" }
             ],
-            "aaSorting": [[ 5, "desc" ]]
+            "aaSorting": [[ 5, "desc" ]],
+            "oLanguage": {
+                "sEmptyTable":     "${_('No data available in table')}",
+                "sInfo":           "${_('Showing _START_ to _END_ of _TOTAL_ entries')}",
+                "sInfoEmpty":      "${_('Showing 0 to 0 of 0 entries')}",
+                "sInfoFiltered":   "${_('(filtered from _MAX_ total entries)')}",
+                "sZeroRecords":    "${_('No matching records found')}",
+                "oPaginate": {
+                    "sFirst":    "${_('First')}",
+                    "sLast":     "${_('Last')}",
+                    "sNext":     "${_('Next')}",
+                    "sPrevious": "${_('Previous')}"
+                }
+            }
         });
 
         $("#filterInput").keyup(function() {