Browse Source

[jobsub] Backend i18n

Romain: fixing some broken strings
Updated language bundles
Enrico Berti 13 years ago
parent
commit
b400f94606

+ 6 - 5
apps/jobsub/src/jobsub/conf.py

@@ -20,33 +20,34 @@ import os.path
 
 from desktop.lib.conf import Config, coerce_bool
 from desktop.lib import paths
+from django.utils.translation import ugettext_lazy as _
 
 REMOTE_DATA_DIR = Config(
   key="remote_data_dir",
   default="/user/hue/jobsub",
-  help="Location on HDFS where the jobsub examples and templates are stored.")
+  help=_("Location on HDFS where the jobsub examples and templates are stored."))
 
 # Where examples and templates are stored.
 LOCAL_DATA_DIR = Config(
   key="local_data_dir",
   default=os.path.join(os.path.dirname(__file__), "..", "..", "data"),
-  help="Location on local FS where examples and template are stored",
+  help=_("Location on local FS where examples and template are stored"),
   private=True)
 
 SAMPLE_DATA_DIR = Config(
   key="sample_data_dir",
   default=paths.get_thirdparty_root("sample_data"),
-  help="Location on local FS where sample data is stored",
+  help=_("Location on local FS where sample data is stored"),
   private=True)
 
 OOZIE_URL = Config(
   key='oozie_url',
-  help='URL to Oozie server. This is required for job submission.',
+  help=_('URL to Oozie server. This is required for job submission.'),
   default='http://localhost:11000/oozie',
   type=str)
 
 SECURITY_ENABLED = Config(
   key="security_enabled",
-  help="Whether Oozie requires client to do perform Kerberos authentication",
+  help=_("Whether Oozie requires client to do perform Kerberos authentication"),
   default=False,
   type=coerce_bool)

+ 5 - 3
apps/jobsub/src/jobsub/forms.py

@@ -22,6 +22,8 @@ from django import forms
 from desktop.lib.django_forms import MultiForm
 from jobsub import models
 
+from django.utils.translation import ugettext as _
+
 LOG = logging.getLogger(__name__)
 
 # This aligns with what Oozie accepts as a workflow name
@@ -34,12 +36,12 @@ class WorkflowDesignForm(forms.ModelForm):
     exclude = ('root_action', 'owner')
 
   name = forms.RegexField(
-        label='Name',
+        label=_('Name'),
         max_length=39,
         regex=_OOZIE_WORKFLOW_NAME_REGEX,
         help_text="Name of the design.",
-        error_messages={'invalid': "Allows alphabets, digits, '_', and '-'. " 
-                        "The first character must be an alphabet or '_'."})
+        error_messages={'invalid': _("Allows alphabets, digits, '_', and '-'. "
+                        "The first character must be an alphabet or '_'.")})
 
 
 class JavaActionForm(forms.ModelForm):

+ 269 - 57
apps/jobsub/src/jobsub/locale/django.pot

@@ -1,4 +1,3 @@
-# Translations template for PROJECT.
 # Copyright (C) 2012 ORGANIZATION
 # This file is distributed under the same license as the PROJECT project.
 # FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
@@ -8,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2012-06-30 02:05+0200\n"
+"POT-Creation-Date: 2012-07-10 13:54+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,88 +16,228 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Generated-By: Babel 0.9.6\n"
 
+#: src/jobsub/conf.py:28
+msgid "Location on HDFS where the jobsub examples and templates are stored."
+msgstr ""
+
+#: src/jobsub/conf.py:34
+msgid "Location on local FS where examples and template are stored"
+msgstr ""
+
+#: src/jobsub/conf.py:40
+msgid "Location on local FS where sample data is stored"
+msgstr ""
+
+#: src/jobsub/conf.py:45
+msgid "URL to Oozie server. This is required for job submission."
+msgstr ""
+
+#: src/jobsub/conf.py:51
+msgid "Whether Oozie requires client to do perform Kerberos authentication"
+msgstr ""
+
+#: src/jobsub/forms.py:39 src/jobsub/templates/list_designs.mako:54
+#: src/jobsub/templates/list_history.mako:45
+#: src/jobsub/templates/workflow.mako:55 src/jobsub/templates/workflow.mako:100
+msgid "Name"
+msgstr ""
+
+#: src/jobsub/forms.py:43
+msgid ""
+"Allows alphabets, digits, '_', and '-'. The first character must be an "
+"alphabet or '_'."
+msgstr ""
+
+#: src/jobsub/models.py:128
+msgid "Name of the design, which must be unique per user"
+msgstr ""
+
+#: src/jobsub/models.py:184 src/jobsub/models.py:225
+msgid "List of paths to files to be added to the distributed cache"
+msgstr ""
+
+#: src/jobsub/models.py:186 src/jobsub/models.py:227
+msgid "List of paths to archives to be added to the distributed cache"
+msgstr ""
+
+#: src/jobsub/models.py:191
+msgid "Path to jar files on HDFS"
+msgstr ""
+
+#: src/jobsub/submit.py:48
+#, python-format
+msgid "Submission for job design '%(name)s' (id %(id)s, owner %(username)s)"
+msgstr ""
+
+#: src/jobsub/submit.py:72
+#, python-format
+msgid "Job design already submitted (Oozie job id %(id)s)"
+msgstr ""
+
+#: src/jobsub/submit.py:81
+msgid "Failed to access deployment directory"
+msgstr ""
+
+#: src/jobsub/submit.py:210
+msgid "Failed to obtain HDFS reference. Please check your configuration."
+msgstr ""
+
+#: src/jobsub/views.py:58
+#, python-format
+msgid "Access denied: view job %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:64
+#, python-format
+msgid "Error accessing Oozie job %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:177
+msgid "Permission denied. You are not the owner."
+msgstr ""
+
+#: src/jobsub/views.py:185
+#, python-format
+msgid "Access denied: delete design %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:193
+msgid "Workflow not found"
+msgstr ""
+
+#: src/jobsub/views.py:201
+#, python-format
+msgid "Access denied: edit design %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:232
+#, python-format
+msgid "Access denied: design parameters %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:244
+msgid "Please use a POST request to submit a design."
+msgstr ""
+
+#: src/jobsub/views.py:248
+#, python-format
+msgid "Access denied: submit design %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:258
+#, python-format
+msgid "Error submitting design %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:273
+msgid "Please use a POST request to install the examples."
+msgstr ""
+
+#: src/jobsub/views.py:278
+msgid "The examples could not be installed."
+msgstr ""
+
+#: src/jobsub/management/commands/jobsub_setup.py:90
+msgid "Unexpected fixture type."
+msgstr ""
+
+#: src/jobsub/management/commands/jobsub_setup.py:93
+msgid "Expected sample user fixture."
+msgstr ""
+
+#: src/jobsub/oozie_lib/types.py:171
+msgid "Insufficient permission"
+msgstr ""
+
+#: src/jobsub/oozie_lib/types.py:172
+#, python-format
+msgid "Permission denied. User %(username)s cannot modify user %(user)s's job."
+msgstr ""
+
 #: src/jobsub/templates/edit_design.mako:26
 #: src/jobsub/templates/list_designs.mako:28
 #: src/jobsub/templates/list_history.mako:26
+#: src/jobsub/templates/workflow.mako:25
 msgid "Job Designer"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:55
+#: src/jobsub/templates/edit_design.mako:54
 #, python-format
 msgid "Job Design (%(type)s type)"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:69
+#: src/jobsub/templates/edit_design.mako:66
 msgid "You can parametrize the values, using"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:69
+#: src/jobsub/templates/edit_design.mako:66
 msgid "or"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:71
+#: src/jobsub/templates/edit_design.mako:68
 msgid ""
 "When the design is submitted, you will be prompted for the actual value "
 "of "
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:79
+#: src/jobsub/templates/edit_design.mako:76
 msgid "Job Properties"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:85
+#: src/jobsub/templates/edit_design.mako:82
 msgid "Property name"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:86
+#: src/jobsub/templates/edit_design.mako:83
+#: src/jobsub/templates/workflow.mako:56
 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
+#: src/jobsub/templates/edit_design.mako:91
+#: src/jobsub/templates/edit_design.mako:116
+#: src/jobsub/templates/edit_design.mako:139
+#: src/jobsub/templates/list_designs.mako:83
 msgid "Delete"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:106
+#: src/jobsub/templates/edit_design.mako:103
 msgid "Add Property"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:111
+#: src/jobsub/templates/edit_design.mako:108
 msgid "Files"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:129
+#: src/jobsub/templates/edit_design.mako:126
 msgid "Add File"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:134
+#: src/jobsub/templates/edit_design.mako:131
 msgid "Archives"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:152
+#: src/jobsub/templates/edit_design.mako:149
 msgid "Add Archive"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:159
+#: src/jobsub/templates/edit_design.mako:156
 msgid "Save"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:160
-#: src/jobsub/templates/list_designs.mako:120
+#: src/jobsub/templates/edit_design.mako:157
+#: src/jobsub/templates/list_designs.mako:109
 msgid "Cancel"
 msgstr ""
 
-#: src/jobsub/templates/edit_design.mako:170
+#: src/jobsub/templates/edit_design.mako:167
 msgid "Choose a file"
 msgstr ""
 
-#: src/jobsub/templates/layout.mako:32
+#: src/jobsub/templates/layout.mako:34
 msgid "Designs"
 msgstr ""
 
-#: src/jobsub/templates/layout.mako:33
+#: src/jobsub/templates/layout.mako:35
 msgid "History"
 msgstr ""
 
@@ -137,13 +276,9 @@ msgstr ""
 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
+#: src/jobsub/templates/workflow.mako:101
 msgid "Type"
 msgstr ""
 
@@ -156,111 +291,112 @@ msgstr ""
 msgid "Last Modified"
 msgstr ""
 
+#: src/jobsub/templates/list_designs.mako:71
 #: 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"
+#: src/jobsub/templates/list_designs.mako:75
+#: src/jobsub/templates/list_designs.mako:108
+msgid "Submit"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:79
-#: src/jobsub/templates/list_designs.mako:119
-msgid "Submit"
+#: src/jobsub/templates/list_designs.mako:76
+#, python-format
+msgid "Edit %(name)s"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:81
+#: src/jobsub/templates/list_designs.mako:77
 msgid "Edit"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:85
+#: src/jobsub/templates/list_designs.mako:80
 #, python-format
 msgid "Delete %(name)s"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:86
+#: src/jobsub/templates/list_designs.mako:81
 #, python-format
 msgid "Are you sure you want to delete %(name)s?"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:94
+#: src/jobsub/templates/list_designs.mako:85
 #, python-format
 msgid "Clone %(name)s"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:96
+#: src/jobsub/templates/list_designs.mako:85
 msgid "Clone"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:110
+#: src/jobsub/templates/list_designs.mako:99
 msgid "Submit this design?"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:129
+#: src/jobsub/templates/list_designs.mako:118
 msgid "Delete this design?"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:132
-#: src/jobsub/templates/list_designs.mako:148
+#: src/jobsub/templates/list_designs.mako:121
+#: src/jobsub/templates/list_designs.mako:137
 msgid "Yes"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:133
-#: src/jobsub/templates/list_designs.mako:149
+#: src/jobsub/templates/list_designs.mako:122
+#: src/jobsub/templates/list_designs.mako:138
 msgid "No"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:142
+#: src/jobsub/templates/list_designs.mako:131
 msgid "Install sample job designs?"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:145
+#: src/jobsub/templates/list_designs.mako:134
 msgid "It will take a few seconds to install."
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:218
+#: src/jobsub/templates/list_designs.mako:207
 #: 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_designs.mako:208
 #: 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_designs.mako:209
 #: 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_designs.mako:210
 #: 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_designs.mako:211
 #: src/jobsub/templates/list_history.mako:87
 msgid "No matching records found"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:224
+#: src/jobsub/templates/list_designs.mako:213
 #: src/jobsub/templates/list_history.mako:89
 msgid "First"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:225
+#: src/jobsub/templates/list_designs.mako:214
 #: src/jobsub/templates/list_history.mako:90
 msgid "Last"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:226
+#: src/jobsub/templates/list_designs.mako:215
 #: src/jobsub/templates/list_history.mako:91
 msgid "Next"
 msgstr ""
 
-#: src/jobsub/templates/list_designs.mako:227
+#: src/jobsub/templates/list_designs.mako:216
 #: src/jobsub/templates/list_history.mako:92
 msgid "Previous"
 msgstr ""
@@ -277,3 +413,79 @@ msgstr ""
 msgid "Submission Date"
 msgstr ""
 
+#: src/jobsub/templates/workflow.mako:81
+msgid "Edit design"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:88
+msgid "Actions"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:89
+msgid "Details"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:90
+msgid "Definition"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:91
+msgid "Log"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:102
+#: src/jobsub/templates/workflow.mako:166
+msgid "Status"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:103
+#: src/jobsub/templates/workflow.mako:170
+msgid "External Id"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:105
+#: src/jobsub/templates/workflow.mako:174
+msgid "Start Time"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:106
+#: src/jobsub/templates/workflow.mako:182
+msgid "End Time"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:108
+msgid "Retries"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:109
+msgid "Error Message"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:110
+msgid "Transition"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:112
+msgid "Data"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:150
+msgid "Application Name"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:158
+msgid "User"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:162
+msgid "Group"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:178
+msgid "Created Time"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:186
+msgid "Application Path"
+msgstr ""
+

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

@@ -0,0 +1,492 @@
+# 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-07-10 13:54+0200\n"
+"PO-Revision-Date: 2012-07-10 13:54+0200\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/conf.py:28
+msgid "Location on HDFS where the jobsub examples and templates are stored."
+msgstr ""
+
+#: src/jobsub/conf.py:34
+msgid "Location on local FS where examples and template are stored"
+msgstr ""
+
+#: src/jobsub/conf.py:40
+msgid "Location on local FS where sample data is stored"
+msgstr ""
+
+#: src/jobsub/conf.py:45
+msgid "URL to Oozie server. This is required for job submission."
+msgstr ""
+
+#: src/jobsub/conf.py:51
+msgid "Whether Oozie requires client to do perform Kerberos authentication"
+msgstr ""
+
+#: src/jobsub/forms.py:39 src/jobsub/templates/list_designs.mako:54
+#: src/jobsub/templates/list_history.mako:45
+#: src/jobsub/templates/workflow.mako:55 src/jobsub/templates/workflow.mako:100
+msgid "Name"
+msgstr ""
+
+#: src/jobsub/forms.py:43
+msgid ""
+"Allows alphabets, digits, '_', and '-'. The first character must be an "
+"alphabet or '_'."
+msgstr ""
+
+#: src/jobsub/models.py:128
+msgid "Name of the design, which must be unique per user"
+msgstr ""
+
+#: src/jobsub/models.py:184 src/jobsub/models.py:225
+msgid "List of paths to files to be added to the distributed cache"
+msgstr ""
+
+#: src/jobsub/models.py:186 src/jobsub/models.py:227
+msgid "List of paths to archives to be added to the distributed cache"
+msgstr ""
+
+#: src/jobsub/models.py:191
+msgid "Path to jar files on HDFS"
+msgstr ""
+
+#: src/jobsub/submit.py:48
+#, python-format
+msgid "Submission for job design '%(name)s' (id %(id)s, owner %(username)s)"
+msgstr ""
+
+#: src/jobsub/submit.py:72
+#, python-format
+msgid "Job design already submitted (Oozie job id %(id)s)"
+msgstr ""
+
+#: src/jobsub/submit.py:81
+msgid "Failed to access deployment directory"
+msgstr ""
+
+#: src/jobsub/submit.py:210
+msgid "Failed to obtain HDFS reference. Please check your configuration."
+msgstr ""
+
+#: src/jobsub/views.py:58
+#, python-format
+msgid "Access denied: view job %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:64
+#, python-format
+msgid "Error accessing Oozie job %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:177
+msgid "Permission denied. You are not the owner."
+msgstr ""
+
+#: src/jobsub/views.py:185
+#, python-format
+msgid "Access denied: delete design %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:193
+msgid "Workflow not found"
+msgstr ""
+
+#: src/jobsub/views.py:201
+#, python-format
+msgid "Access denied: edit design %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:232
+#, python-format
+msgid "Access denied: design parameters %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:244
+msgid "Please use a POST request to submit a design."
+msgstr ""
+
+#: src/jobsub/views.py:248
+#, python-format
+msgid "Access denied: submit design %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:258
+#, python-format
+msgid "Error submitting design %(id)s"
+msgstr ""
+
+#: src/jobsub/views.py:273
+msgid "Please use a POST request to install the examples."
+msgstr ""
+
+#: src/jobsub/views.py:278
+msgid "The examples could not be installed."
+msgstr ""
+
+#: src/jobsub/management/commands/jobsub_setup.py:90
+msgid "Unexpected fixture type."
+msgstr ""
+
+#: src/jobsub/management/commands/jobsub_setup.py:93
+msgid "Expected sample user fixture."
+msgstr ""
+
+#: src/jobsub/oozie_lib/types.py:171
+msgid "Insufficient permission"
+msgstr ""
+
+#: src/jobsub/oozie_lib/types.py:172
+#, python-format
+msgid "Permission denied. User %(username)s cannot modify user %(user)s's job."
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:26
+#: src/jobsub/templates/list_designs.mako:28
+#: src/jobsub/templates/list_history.mako:26
+#: src/jobsub/templates/workflow.mako:25
+msgid "Job Designer"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:54
+#, python-format
+msgid "Job Design (%(type)s type)"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:66
+msgid "You can parametrize the values, using"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:66
+msgid "or"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:68
+msgid ""
+"When the design is submitted, you will be prompted for the actual value "
+"of "
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:76
+msgid "Job Properties"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:82
+msgid "Property name"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:83
+#: src/jobsub/templates/workflow.mako:56
+msgid "Value"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:91
+#: src/jobsub/templates/edit_design.mako:116
+#: src/jobsub/templates/edit_design.mako:139
+#: src/jobsub/templates/list_designs.mako:83
+msgid "Delete"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:103
+msgid "Add Property"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:108
+msgid "Files"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:126
+msgid "Add File"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:131
+msgid "Archives"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:149
+msgid "Add Archive"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:156
+msgid "Save"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:157
+#: src/jobsub/templates/list_designs.mako:109
+msgid "Cancel"
+msgstr ""
+
+#: src/jobsub/templates/edit_design.mako:167
+msgid "Choose a file"
+msgstr ""
+
+#: src/jobsub/templates/layout.mako:34
+msgid "Designs"
+msgstr ""
+
+#: src/jobsub/templates/layout.mako:35
+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:55
+#: src/jobsub/templates/list_history.mako:46
+#: src/jobsub/templates/workflow.mako:101
+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:71
+#: src/jobsub/templates/list_designs.mako:72
+#, python-format
+msgid "Submit %(name)s to the cluster"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:75
+#: src/jobsub/templates/list_designs.mako:108
+msgid "Submit"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:76
+#, python-format
+msgid "Edit %(name)s"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:77
+msgid "Edit"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:80
+#, python-format
+msgid "Delete %(name)s"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:81
+#, python-format
+msgid "Are you sure you want to delete %(name)s?"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:85
+#, python-format
+msgid "Clone %(name)s"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:85
+msgid "Clone"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:99
+msgid "Submit this design?"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:118
+msgid "Delete this design?"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:121
+#: src/jobsub/templates/list_designs.mako:137
+msgid "Yes"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:122
+#: src/jobsub/templates/list_designs.mako:138
+msgid "No"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:131
+msgid "Install sample job designs?"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:134
+msgid "It will take a few seconds to install."
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:207
+#: src/jobsub/templates/list_history.mako:83
+msgid "No data available in table"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:208
+#: src/jobsub/templates/list_history.mako:84
+msgid "Showing _START_ to _END_ of _TOTAL_ entries"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:209
+#: src/jobsub/templates/list_history.mako:85
+msgid "Showing 0 to 0 of 0 entries"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:210
+#: src/jobsub/templates/list_history.mako:86
+msgid "(filtered from _MAX_ total entries)"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:211
+#: src/jobsub/templates/list_history.mako:87
+msgid "No matching records found"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:213
+#: src/jobsub/templates/list_history.mako:89
+msgid "First"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:214
+#: src/jobsub/templates/list_history.mako:90
+msgid "Last"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:215
+#: src/jobsub/templates/list_history.mako:91
+msgid "Next"
+msgstr ""
+
+#: src/jobsub/templates/list_designs.mako:216
+#: 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 ""
+
+#: src/jobsub/templates/workflow.mako:81
+msgid "Edit design"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:88
+msgid "Actions"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:89
+msgid "Details"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:90
+msgid "Definition"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:91
+msgid "Log"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:102
+#: src/jobsub/templates/workflow.mako:166
+msgid "Status"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:103
+#: src/jobsub/templates/workflow.mako:170
+msgid "External Id"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:105
+#: src/jobsub/templates/workflow.mako:174
+msgid "Start Time"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:106
+#: src/jobsub/templates/workflow.mako:182
+msgid "End Time"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:108
+msgid "Retries"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:109
+msgid "Error Message"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:110
+msgid "Transition"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:112
+msgid "Data"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:150
+msgid "Application Name"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:158
+msgid "User"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:162
+msgid "Group"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:178
+msgid "Created Time"
+msgstr ""
+
+#: src/jobsub/templates/workflow.mako:186
+msgid "Application Path"
+msgstr ""
+

+ 4 - 2
apps/jobsub/src/jobsub/management/commands/jobsub_setup.py

@@ -34,6 +34,8 @@ import hadoop.conf
 import jobsub.conf
 from jobsub.submit import Submission
 
+from django.utils.translation import ugettext as _
+
 LOG = logging.getLogger(__name__)
 
 
@@ -85,10 +87,10 @@ class Command(NoArgsCommand):
         key = example.object.pk
         sample_oozie_abstract_actions[key] = example
       else:
-        raise Exception("Unexpected fixture type.")
+        raise Exception(_("Unexpected fixture type."))
 
     if sample_user is None:
-      raise Exception("Expected sample user fixture.")
+      raise Exception(_("Expected sample user fixture."))
     # Create the sample user if it doesn't exist
     try:
       sample_user.object = User.objects.get(username=sample_user.object.username)

+ 8 - 6
apps/jobsub/src/jobsub/models.py

@@ -26,6 +26,8 @@ from django.core import urlresolvers
 from django.contrib.auth.models import User
 from jobsub.parameterization import find_parameters, bind_parameters
 
+from django.utils.translation import ugettext_lazy as _
+
 LOG = logging.getLogger(__name__)
 
 
@@ -123,7 +125,7 @@ class OozieDesign(models.Model):
   # Generic stuff
   owner = models.ForeignKey(User)
   name = models.CharField(max_length=64, blank=False,
-      help_text='Name of the design, which must be unique per user')
+      help_text=_('Name of the design, which must be unique per user'))
   description = models.CharField(max_length=1024, blank=True)
   last_modified = models.DateTimeField(auto_now=True)
 
@@ -179,14 +181,14 @@ class OozieMapreduceAction(OozieAction):
 
   # For the distributed cache. JSON arrays.
   files = models.CharField(max_length=PATH_MAX, default="[]",
-      help_text='List of paths to files to be added to the distributed cache')
+      help_text=_('List of paths to files to be added to the distributed cache'))
   archives = models.CharField(max_length=PATH_MAX, default="[]",
-      help_text='List of paths to archives to be added to the distributed cache')
+      help_text=_('List of paths to archives to be added to the distributed cache'))
   # For the job configuration. JSON dict. Required (e.g. mapred.mapper.class).
   job_properties = models.CharField(max_length=32768, default="[]")
   # Location of the jar in hdfs
   jar_path = models.CharField(max_length=PATH_MAX,
-      help_text='Path to jar files on HDFS')
+      help_text=_('Path to jar files on HDFS'))
 
 
 class OozieStreamingAction(OozieAction):
@@ -220,9 +222,9 @@ class OozieJavaAction(OozieAction):
 
   # For the distributed cache. JSON arrays.
   files = models.CharField(max_length=PATH_MAX, default="[]",
-      help_text='List of paths to files to be added to the distributed cache')
+      help_text=_('List of paths to files to be added to the distributed cache'))
   archives = models.CharField(max_length=PATH_MAX, default="[]",
-      help_text='List of paths to archives to be added to the distributed cache')
+      help_text=_('List of paths to archives to be added to the distributed cache'))
   # Location of the jar in hdfs
   jar_path = models.CharField(max_length=PATH_MAX, blank=False)
   main_class = models.CharField(max_length=256, blank=False)

+ 5 - 3
apps/jobsub/src/jobsub/oozie_lib/types.py

@@ -13,6 +13,8 @@ from desktop.log.access import access_warn
 import hadoop.confparse
 from jobsub.oozie_lib.utils import parse_timestamp
 
+from django.utils.translation import ugettext as _
+
 # TODO(bc)  Smarter link from action to jobtracker
 class Action(object):
   """
@@ -166,9 +168,9 @@ class Workflow(object):
   def check_request_permission(self, request):
     """Raise PopupException if request user doesn't have permission to modify workflow"""
     if not request.user.is_superuser and request.user.username != self.user:
-      access_warn(request, 'Insufficient permission')
-      raise PopupException("Permission denied. User %s cannot modify user %s's job." %
-                           (request.user.username, self.user))
+      access_warn(request, _('Insufficient permission'))
+      raise PopupException(_("Permission denied. User %(username)s cannot modify user %(user)s's job.") %
+                           dict(username=request.user.username, user=self.user))
 
 
 class WorkflowList(object):

+ 8 - 6
apps/jobsub/src/jobsub/submit.py

@@ -30,6 +30,8 @@ from hadoop.fs.hadoopfs import Hdfs
 from jobsub import conf, models
 from jobsub.oozie_lib.oozie_api import get_oozie
 
+from django.utils.translation import ugettext as _
+
 LOG = logging.getLogger(__name__)
 
 
@@ -43,8 +45,8 @@ class Submission(object):
     self._job_id = None       # The oozie workflow instance id
 
   def __unicode__(self):
-    res = "Submission for job design '%s' (id %s, owner %s)" % \
-        (self._design_obj.name, self._design_obj.id, self._username)
+    res = _("Submission for job design '%(name)s' (id %(id)s, owner %(username)s)") % \
+        dict(name=self._design_obj.name, id=self._design_obj.id, username=self._username)
     if self.job_id:
       res += " -- " + self.job_id
     return res
@@ -67,7 +69,7 @@ class Submission(object):
     Returns the oozie job id if all goes well.
     """
     if self.job_id is not None:
-      raise Exception("Job design already submitted (Oozie job id %s)" % (self.job_id,))
+      raise Exception(_("Job design already submitted (Oozie job id %(id)s)") % dict(id=(self.job_id,)))
 
     fs_defaultfs = self._fs.fs_defaultfs
     jobtracker = hadoop.cluster.get_cluster_addr_for_job_submission()
@@ -76,7 +78,7 @@ class Submission(object):
       wf_dir = self._get_and_create_deployment_dir()
     except Exception, ex:
       LOG.exception("Failed to access deployment directory")
-      raise PopupException(message="Failed to access deployment directory",
+      raise PopupException(message=_("Failed to access deployment directory"),
                            detail=str(ex))
 
     wf_xml = self._generate_workflow_xml(fs_defaultfs)
@@ -205,8 +207,8 @@ class Submission(object):
   def _get_deployment_dir(self):
     """Return the workflow deployment directory"""
     if self._fs is None:
-      raise PopupException("Failed to obtain HDFS reference. "
-                           "Please check your configuration.")
+      raise PopupException(_("Failed to obtain HDFS reference. "
+                           "Please check your configuration."))
 
     # We could have collision with usernames. But there's no good separator.
     # Hope people don't create crazy usernames.

+ 13 - 12
apps/jobsub/src/jobsub/views.py

@@ -45,6 +45,7 @@ from jobsub.management.commands import jobsub_setup
 from jobsub.oozie_lib.oozie_api import get_oozie
 import jobsub.forms
 
+from django.utils.translation import ugettext as _
 
 LOG = logging.getLogger(__name__)
 
@@ -54,13 +55,13 @@ def oozie_job(request, jobid):
   try:
     workflow = get_oozie().get_job(jobid)
     _check_permission(request, workflow.user,
-                      "Access denied: view job %s" % (jobid,),
+                      _("Access denied: view job %(id)s") % {'id': jobid},
                       allow_root=True)
     # Accessing log and definition will trigger Oozie API calls
     log = workflow.log
     definition = workflow.definition
   except RestException, ex:
-    raise PopupException("Error accessing Oozie job %s" % (jobid,),
+    raise PopupException(_("Error accessing Oozie job %(id)s") % {'id': jobid},
                          detail=ex.message)
 
   # Cross reference the submission history (if any)
@@ -173,7 +174,7 @@ def _check_permission(request, owner_name, error_msg, allow_root=False):
     if allow_root and request.user.is_superuser:
       return
     access_warn(request, error_msg)
-    raise PopupException("Permission denied. You are not the owner.")
+    raise PopupException(_("Permission denied. You are not the owner."))
 
 
 def delete_design(request, design_id):
@@ -181,7 +182,7 @@ def delete_design(request, design_id):
     try:
       design_obj = _get_design(design_id)
       _check_permission(request, design_obj.owner.username,
-                        "Access denied: delete design %s" % (design_id,),
+                        _("Access denied: delete design %(id)s") % {'id': design_id},
                         allow_root=True)
       design_obj.root_action.delete()
       design_obj.delete()
@@ -189,7 +190,7 @@ def delete_design(request, design_id):
       submit.Submission(design_obj, request.fs).remove_deployment_dir()
     except models.OozieDesign.DoesNotExist:
       LOG.error("Trying to delete non-existent design (id %s)" % (design_id,))
-      raise PopupException("Workflow not found")
+      raise PopupException(_("Workflow not found"))
 
   return redirect(urlresolvers.reverse(list_designs))
 
@@ -197,7 +198,7 @@ def delete_design(request, design_id):
 def edit_design(request, design_id):
   design_obj = _get_design(design_id)
   _check_permission(request, design_obj.owner.username,
-                    "Access denied: edit design %s" % (design_id,))
+                    _("Access denied: edit design %(id)s") % {'id': design_id})
 
   if request.method == 'POST':
     form = jobsub.forms.design_form_by_instance(design_obj, request.POST)
@@ -228,7 +229,7 @@ def get_design_params(request, design_id):
   """
   design_obj = _get_design(design_id)
   _check_permission(request, design_obj.owner.username,
-                    "Access denied: design parameters %s" % (design_id,))
+                    _("Access denied: design parameters %(id)s") % {'id': design_id})
   params = design_obj.find_parameters()
   params_with_labels = dict((p, p.upper()) for p in params)
   return render('dont_care_for_ajax', request, { 'params': params_with_labels })
@@ -240,11 +241,11 @@ def submit_design(request, design_id):
   The POST data should contain parameter values.
   """
   if request.method != 'POST':
-    raise PopupException('Please use a POST request to submit a design.')
+    raise PopupException(_('Please use a POST request to submit a design.'))
 
   design_obj = _get_design(design_id)
   _check_permission(request, design_obj.owner.username,
-                    "Access denied: submit design %s" % (design_id,))
+                    _("Access denied: submit design %(id)s") % {'id': design_id})
 
   # Expect the parameter mapping in the POST data
   param_mapping = request.POST
@@ -254,7 +255,7 @@ def submit_design(request, design_id):
     submission = submit.Submission(design_obj, request.fs)
     jobid = submission.run()
   except RestException, ex:
-    raise PopupException("Error submitting design %s" % (design_id,),
+    raise PopupException(_("Error submitting design %(id)s") % {'id': design_id},
                          detail=ex.message)
   # Save the submission record
   job_record = models.JobHistory(owner=request.user,
@@ -269,12 +270,12 @@ def submit_design(request, design_id):
 def setup(request):
   """Installs jobsub examples."""
   if request.method != "POST":
-    raise PopupException('Please use a POST request to install the examples.')
+    raise PopupException(_('Please use a POST request to install the examples.'))
   try:
     # Warning: below will modify fs.user
     jobsub_setup.Command().handle_noargs()
   except WebHdfsException, e:
-    raise PopupException('The examples could not be installed.', detail=e)
+    raise PopupException(_('The examples could not be installed.'), detail=e)
   return redirect(urlresolvers.reverse(list_designs))