فهرست منبع

HUE-764 [shell] Templates Internationalization

Created message bundles for all the templates
Reorganized imports
Got rid of HTML in the message bundle
Enrico Berti 13 سال پیش
والد
کامیت
3e57c8905a

+ 2 - 0
apps/shell/babel.cfg

@@ -0,0 +1,2 @@
+[python: src/shell/**.py]
+[mako: src/shell/templates/**.mako]

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

@@ -0,0 +1,80 @@
+# 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-06-30 02:19+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/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 ""
+

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

@@ -0,0 +1,80 @@
+# 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-06-30 02:19+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/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 ""
+

+ 10 - 9
apps/shell/src/shell/templates/failed_to_create.mako

@@ -15,19 +15,20 @@
 ## limitations under the License.
 <%!
 from desktop.views import commonheader, commonfooter
+from django.utils.translation import ugettext as _
 %>
 
-${commonheader("Hue Shell", "shell")}
+${commonheader(_('Hue Shell'), "shell")}
 <div class="container-fluid">
 <div>
-	Failed to create a shell of the given type. The possible reasons for this are:
-	<ol>
-		<li>The system is out of PTYs.</li>
-		<li>The system cannot create more subprocesses.</li>
-		<li>You do not have permission to create shells of this type.</li>
-		<li>There is no shell with that name.</li>
-		<li>There is no Unix user account for you.</li>
-	</ol>
+    ${_('Failed to create a shell of the given type. The possible reasons for this are:')}
+    <ol>
+        <li>${_('The system is out of PTYs.')}</li>
+        <li>${_('The system cannot create more subprocesses.')}</li>
+        <li>${_('You do not have permission to create shells of this type.')}</li>
+        <li>${_('There is no shell with that name.')}</li>
+        <li>${_('There is no Unix user account for you.')}</li>
+    </ol>
 </div>
 </div>
 ${commonfooter()}

+ 5 - 4
apps/shell/src/shell/templates/index.mako

@@ -15,12 +15,13 @@
 ## limitations under the License.
 <%!
 from desktop.views import commonheader, commonfooter
+from django.utils.translation import ugettext as _
 %>
 
 % if shells:
-    ${commonheader("Hue Shell", "shell", "100px")}
+    ${commonheader(_('Hue Shell'), "shell", "100px")}
 % else:
-    ${commonheader("Hue Shell", "shell")}
+    ${commonheader(_('Hue Shell'), "shell")}
 % endif
 
 
@@ -107,9 +108,9 @@ from desktop.views import commonheader, commonfooter
     <div>
         <h3>
             % if shells:
-                Please select one of the available shells from the toolbar above.
+                ${_('Please select one of the available shells from the toolbar above.')}
             % else:
-                You don't have permission to access any shell or there is no configured shell.
+                ${_('You do not have permission to access any shell or there is no configured shell.')}
             % endif
         </h3>
     </div>

+ 6 - 4
apps/shell/src/shell/templates/no_such_user.mako

@@ -15,14 +15,16 @@
 ## limitations under the License.
 <%!
 from desktop.views import commonheader, commonfooter
+from django.utils.translation import ugettext as _
 %>
 
-${commonheader("Hue Shell", "shell")}
+${commonheader(_('Hue Shell'), "shell")}
 <div class="container-fluid">
 <div>
-	The Shell app requires a Unix user account for every user of Hue on the remote webserver.
-	Please ask your admin to create a user account for you on the remote webserver as
-	described in the Shell documentation.
+    ${_('The Shell app requires a Unix user account for every user of Hue on the remote webserver.')}
+    <br/>
+    ${_('Please ask your admin to create a user account for you on the remote webserver as described in the Shell documentation.')}
+
 </div>
 </div>
 ${commonfooter()}

+ 3 - 2
apps/shell/src/shell/templates/not_running_spawning.mako

@@ -15,12 +15,13 @@
 ## limitations under the License.
 <%!
 from desktop.views import commonheader, commonfooter
+from django.utils.translation import ugettext as _
 %>
 
-${commonheader("Hue Shell", "shell")}
+${commonheader(_('Hue Shell'), "shell")}
 <div class="container-fluid">
 <div>
-	<h3>The webserver currently running Hue does not support the Shell app. Please contact your administrator.</h3>
+	<h3>${_('The webserver currently running Hue does not support the Shell app. Please contact your administrator.')}</h3>
 </div>
 </div>
 ${commonfooter()}