浏览代码

HUE-764 [shell] Backend i18n

Romain: fix breaking strings
Enrico Berti 13 年之前
父节点
当前提交
053506c

+ 97 - 0
apps/shell/src/shell/locale/django.pot

@@ -0,0 +1,97 @@
+# 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.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PROJECT VERSION\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2012-07-10 12:26+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"
+"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/shell/settings.py:23
+msgid "Launch the Pig Shell"
+msgstr ""
+
+#: src/shell/settings.py:24
+msgid "Launch the Flume Shell"
+msgstr ""
+
+#: src/shell/settings.py:25
+msgid "Launch the HBase Shell"
+msgstr ""
+
+#: src/shell/shellmanager.py:147
+#, python-format
+msgid "bin/hadoop return non-zero %(retcode)d while trying to merge credentials"
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:21
+#: src/shell/templates/index.mako:22 src/shell/templates/index.mako:24
+#: src/shell/templates/no_such_user.mako:21
+#: src/shell/templates/not_running_spawning.mako:21
+msgid "Hue Shell"
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:24
+msgid ""
+"Failed to create a shell of the given type. The possible reasons for this"
+" are:"
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:26
+msgid "The system is out of PTYs."
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:27
+msgid "The system cannot create more subprocesses."
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:28
+msgid "You do not have permission to create shells of this type."
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:29
+msgid "There is no shell with that name."
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:30
+msgid "There is no Unix user account for you."
+msgstr ""
+
+#: src/shell/templates/index.mako:111
+msgid "Please select one of the available shells from the toolbar above."
+msgstr ""
+
+#: src/shell/templates/index.mako:113
+msgid ""
+"You do not have permission to access any shell or there is no configured "
+"shell."
+msgstr ""
+
+#: src/shell/templates/no_such_user.mako:24
+msgid ""
+"The Shell app requires a Unix user account for every user of Hue on the "
+"remote webserver."
+msgstr ""
+
+#: src/shell/templates/no_such_user.mako:26
+msgid ""
+"Please ask your admin to create a user account for you on the remote "
+"webserver as described in the Shell documentation."
+msgstr ""
+
+#: src/shell/templates/not_running_spawning.mako:24
+msgid ""
+"The webserver currently running Hue does not support the Shell app. "
+"Please contact your administrator."
+msgstr ""
+

+ 97 - 0
apps/shell/src/shell/locale/en_US/LC_MESSAGES/django.po

@@ -0,0 +1,97 @@
+# 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 12:26+0200\n"
+"PO-Revision-Date: 2012-06-30 02:19+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/shell/settings.py:23
+msgid "Launch the Pig Shell"
+msgstr ""
+
+#: src/shell/settings.py:24
+msgid "Launch the Flume Shell"
+msgstr ""
+
+#: src/shell/settings.py:25
+msgid "Launch the HBase Shell"
+msgstr ""
+
+#: src/shell/shellmanager.py:147
+#, python-format
+msgid "bin/hadoop return non-zero %(retcode)d while trying to merge credentials"
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:21
+#: src/shell/templates/index.mako:22 src/shell/templates/index.mako:24
+#: src/shell/templates/no_such_user.mako:21
+#: src/shell/templates/not_running_spawning.mako:21
+msgid "Hue Shell"
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:24
+msgid ""
+"Failed to create a shell of the given type. The possible reasons for this"
+" are:"
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:26
+msgid "The system is out of PTYs."
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:27
+msgid "The system cannot create more subprocesses."
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:28
+msgid "You do not have permission to create shells of this type."
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:29
+msgid "There is no shell with that name."
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:30
+msgid "There is no Unix user account for you."
+msgstr ""
+
+#: src/shell/templates/index.mako:111
+msgid "Please select one of the available shells from the toolbar above."
+msgstr ""
+
+#: src/shell/templates/index.mako:113
+msgid ""
+"You do not have permission to access any shell or there is no configured "
+"shell."
+msgstr ""
+
+#: src/shell/templates/no_such_user.mako:24
+msgid ""
+"The Shell app requires a Unix user account for every user of Hue on the "
+"remote webserver."
+msgstr ""
+
+#: src/shell/templates/no_such_user.mako:26
+msgid ""
+"Please ask your admin to create a user account for you on the remote "
+"webserver as described in the Shell documentation."
+msgstr ""
+
+#: src/shell/templates/not_running_spawning.mako:24
+msgid ""
+"The webserver currently running Hue does not support the Shell app. "
+"Please contact your administrator."
+msgstr ""
+

+ 33 - 17
apps/shell/src/shell/locale/fr/LC_MESSAGES/django.po

@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2012-07-03 15:25-0700\n"
+"POT-Creation-Date: 2012-07-10 12:26+0200\n"
 "PO-Revision-Date: 2012-07-03 12:23-0700\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: fr <LL@li.org>\n"
@@ -17,47 +17,63 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Generated-By: Babel 0.9.6\n"
 
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/failed_to_create.mako:21
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/index.mako:22
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/index.mako:24
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/no_such_user.mako:21
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/not_running_spawning.mako:21
+#: src/shell/settings.py:23
+msgid "Launch the Pig Shell"
+msgstr ""
+
+#: src/shell/settings.py:24
+msgid "Launch the Flume Shell"
+msgstr ""
+
+#: src/shell/settings.py:25
+msgid "Launch the HBase Shell"
+msgstr ""
+
+#: src/shell/shellmanager.py:147
+#, python-format
+msgid "bin/hadoop return non-zero %(retcode)d while trying to merge credentials"
+msgstr ""
+
+#: src/shell/templates/failed_to_create.mako:21
+#: src/shell/templates/index.mako:22 src/shell/templates/index.mako:24
+#: src/shell/templates/no_such_user.mako:21
+#: src/shell/templates/not_running_spawning.mako:21
 msgid "Hue Shell"
 msgstr "Hue Shell"
 
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/failed_to_create.mako:24
+#: src/shell/templates/failed_to_create.mako:24
 msgid ""
 "Failed to create a shell of the given type. The possible reasons for this"
 " are:"
 msgstr "Echec de la creation du terminal demande. Les raisons possibles sont:"
 
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/failed_to_create.mako:26
+#: src/shell/templates/failed_to_create.mako:26
 msgid "The system is out of PTYs."
 msgstr "Le systeme n'a plus de PTYs disponible."
 
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/failed_to_create.mako:27
+#: src/shell/templates/failed_to_create.mako:27
 msgid "The system cannot create more subprocesses."
 msgstr "Le systeme ne peut plus creer de processus."
 
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/failed_to_create.mako:28
+#: src/shell/templates/failed_to_create.mako:28
 msgid "You do not have permission to create shells of this type."
 msgstr "Vous n'avez pas la permission de creer des terminaux de ce type."
 
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/failed_to_create.mako:29
+#: src/shell/templates/failed_to_create.mako:29
 msgid "There is no shell with that name."
 msgstr "Il n'y a pas de terminal de ce nom."
 
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/failed_to_create.mako:30
+#: src/shell/templates/failed_to_create.mako:30
 msgid "There is no Unix user account for you."
 msgstr "Votre compte Unix n'existe pas."
 
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/index.mako:111
+#: src/shell/templates/index.mako:111
 msgid "Please select one of the available shells from the toolbar above."
 msgstr ""
 "S'il vous plait veuillez selectionner un des terminaux disponibles \"\n"
 "\"depuis la bar de menus ci dessus."
 
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/index.mako:113
+#: src/shell/templates/index.mako:113
 msgid ""
 "You do not have permission to access any shell or there is no configured "
 "shell."
@@ -65,7 +81,7 @@ msgstr ""
 "Vous n'avez pas la permission de creer des terminaux ou bien aucun d'eux "
 "n'est configure."
 
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/no_such_user.mako:24
+#: src/shell/templates/no_such_user.mako:24
 msgid ""
 "The Shell app requires a Unix user account for every user of Hue on the "
 "remote webserver."
@@ -73,7 +89,7 @@ msgstr ""
 "L'application Shell necessite un compte Unix pour chaque utilisateur de "
 "Hue sur le server distant."
 
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/no_such_user.mako:26
+#: src/shell/templates/no_such_user.mako:26
 msgid ""
 "Please ask your admin to create a user account for you on the remote "
 "webserver as described in the Shell documentation."
@@ -82,7 +98,7 @@ msgstr ""
 " compte sur le serveur distant comme descrit dans la documentation de "
 "Shell."
 
-#: /home/romain/projects/hue/apps/shell/src/shell/templates/not_running_spawning.mako:24
+#: src/shell/templates/not_running_spawning.mako:24
 #, fuzzy
 msgid ""
 "The webserver currently running Hue does not support the Shell app. "

+ 3 - 1
apps/shell/src/shell/shellmanager.py

@@ -43,6 +43,8 @@ from hadoop.cluster import all_mrclusters, get_all_hdfs, \
 
 from desktop.conf import KERBEROS
 
+from django.utils.translation import ugettext as _
+
 LOG = logging.getLogger(__name__)
 SHELL_OUTPUT_LOGGER = logging.getLogger("shell_output")
 SHELL_INPUT_LOGGER = logging.getLogger("shell_input")
@@ -142,7 +144,7 @@ class Shell(object):
     retcode = merge_process.wait()
     if retcode != 0:
       LOG.error("Failed to merge credentials :'%s'..." % (merge_process.stderr.readline(),))
-      raise MergeToolException("bin/hadoop return non-zero %d while trying to merge credentials" % (retcode,))
+      raise MergeToolException(_("bin/hadoop return non-zero %(retcode)d while trying to merge credentials") % dict(retcode=(retcode,)))
     return merged_token_file
 
   def _get_delegation_tokens(self, username, delegation_token_dir):