Эх сурвалжийг харах

HUE-765 [admin] Template Internationalization

Created message bundles for all the templates
Reorganized imports
Got rid of HTML in the message bundle
Enrico Berti 13 жил өмнө
parent
commit
20be268ace

+ 242 - 6
apps/useradmin/src/useradmin/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-30 16:44-0800\n"
+"POT-Creation-Date: 2012-06-30 02:12+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,23 +17,259 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Generated-By: Babel 0.9.6\n"
 
-#: src/useradmin/templates/list_users.mako:31
-msgid "Username"
+#: src/useradmin/templates/confirm.mako:22
+msgid "Confirm"
+msgstr ""
+
+#: src/useradmin/templates/confirm.mako:25
+#: src/useradmin/templates/list_groups.mako:81
+#: src/useradmin/templates/list_users.mako:110
+msgid "Yes"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:26
+#: src/useradmin/templates/list_groups.mako:24
+#: src/useradmin/templates/list_groups.mako:28
+msgid "Hue Groups"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:48
+#, python-format
+msgid "Hue Groups - Edit group: %(name)s"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:53
+msgid "Hue Groups - Add/sync LDAP group"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:55
+msgid "Hue Groups - Create group"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:68
+msgid "Update group"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:71
+msgid "Add/Sync group"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:73
+#: src/useradmin/templates/list_groups.mako:32
+msgid "Add group"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:76
+#: src/useradmin/templates/edit_permissions.mako:56
+#: src/useradmin/templates/edit_user.mako:73
+#: src/useradmin/templates/list_users.mako:97
+msgid "Cancel"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:84
+#: src/useradmin/templates/edit_group.mako:89
+#: src/useradmin/templates/edit_permissions.mako:65
+#: src/useradmin/templates/edit_user.mako:80
+msgid "Select all"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:85
+#: src/useradmin/templates/edit_group.mako:90
+#: src/useradmin/templates/edit_permissions.mako:66
+#: src/useradmin/templates/edit_user.mako:81
+msgid "Search"
+msgstr ""
+
+#: src/useradmin/templates/edit_permissions.mako:23
+#: src/useradmin/templates/list_permissions.mako:25
+#: src/useradmin/templates/list_permissions.mako:29
+msgid "Hue Permissions"
+msgstr ""
+
+#: src/useradmin/templates/edit_permissions.mako:44
+#, python-format
+msgid "Hue Permissions - Edit app: %(app)s"
 msgstr ""
 
+#: src/useradmin/templates/edit_permissions.mako:55
+msgid "Update permission"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:24
+#: src/useradmin/templates/list_users.mako:24
+#: src/useradmin/templates/list_users.mako:28
+msgid "Hue Users"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:45
+#, python-format
+msgid "Hue Users - Edit user: %(username)s"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:50
+msgid "Hue Users - Add/sync LDAP user"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:52
+msgid "Hue Users - Create user"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:65
+msgid "Update user"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:68
+msgid "Add/Sync user"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:70
 #: src/useradmin/templates/list_users.mako:32
-msgid "First Name"
+msgid "Add user"
+msgstr ""
+
+#: src/useradmin/templates/layout.mako:32
+msgid "Users"
+msgstr ""
+
+#: src/useradmin/templates/layout.mako:33
+#: src/useradmin/templates/list_permissions.mako:40
+#: src/useradmin/templates/list_users.mako:48
+msgid "Groups"
+msgstr ""
+
+#: src/useradmin/templates/layout.mako:34
+#: src/useradmin/templates/list_groups.mako:45
+msgid "Permissions"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:33
+msgid "Add/Sync LDAP group"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:37
+#: src/useradmin/templates/list_permissions.mako:32
+#: src/useradmin/templates/list_users.mako:38
+msgid "Filter: "
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:37
+msgid "Search for group name, members, etc..."
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:43
+msgid "Group Name"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:44
+msgid "Members"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:60
+#, python-format
+msgid "Edit %(groupname)s"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:61
+#, python-format
+msgid "Delete %(groupname)s"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:63
+#: src/useradmin/templates/list_permissions.mako:54
+#: src/useradmin/templates/list_users.mako:68
+msgid "Edit"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:64
+#: src/useradmin/templates/list_users.mako:69
+msgid "Delete"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:78
+#: src/useradmin/templates/list_users.mako:107
+msgid "Confirm action"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:82
+#: src/useradmin/templates/list_users.mako:111
+msgid "No"
+msgstr ""
+
+#: src/useradmin/templates/list_permissions.mako:32
+msgid "Search for application name, description, etc..."
+msgstr ""
+
+#: src/useradmin/templates/list_permissions.mako:38
+msgid "Application"
+msgstr ""
+
+#: src/useradmin/templates/list_permissions.mako:39
+msgid "Permission"
+msgstr ""
+
+#: src/useradmin/templates/list_permissions.mako:54
+msgid "Edit permission"
 msgstr ""
 
 #: src/useradmin/templates/list_users.mako:33
-msgid "Last Name"
+msgid "Add/sync LDAP user"
 msgstr ""
 
 #: src/useradmin/templates/list_users.mako:34
+msgid "Sync LDAP users/groups"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:38
+msgid "Search for username, name, e-mail, etc..."
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:44
+msgid "Username"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:45
+msgid "First Name"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:46
+msgid "Last Name"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:47
 msgid "E-mail"
 msgstr ""
 
-#: src/useradmin/templates/list_users.mako:35
+#: src/useradmin/templates/list_users.mako:49
 msgid "Last Login"
 msgstr ""
 
+#: src/useradmin/templates/list_users.mako:64
+#, python-format
+msgid "Edit %(username)s"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:65
+#, python-format
+msgid "Delete %(username)s"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:86
+msgid "Sync LDAP users and groups"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:90
+msgid ""
+"This will not import any users or groups that don't already exist in Hue."
+" Only users and groups imported from LDAP can be synced."
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:92
+msgid ""
+"All user information and group memberships will be updated based on the "
+"LDAP server's current state."
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:98
+msgid "Sync"
+msgstr ""
+

+ 247 - 11
apps/useradmin/src/useradmin/locale/en_US/LC_MESSAGES/django.po

@@ -7,8 +7,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2012-01-30 16:44-0800\n"
-"PO-Revision-Date: 2012-01-30 16:58-0800\n"
+"POT-Creation-Date: 2012-06-30 02:12+0200\n"
+"PO-Revision-Date: 2012-06-30 02:12+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"
@@ -17,23 +17,259 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Generated-By: Babel 0.9.6\n"
 
-#: src/useradmin/templates/list_users.mako:31
-msgid "Username"
-msgstr "--Username"
+#: src/useradmin/templates/confirm.mako:22
+msgid "Confirm"
+msgstr ""
+
+#: src/useradmin/templates/confirm.mako:25
+#: src/useradmin/templates/list_groups.mako:81
+#: src/useradmin/templates/list_users.mako:110
+msgid "Yes"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:26
+#: src/useradmin/templates/list_groups.mako:24
+#: src/useradmin/templates/list_groups.mako:28
+msgid "Hue Groups"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:48
+#, python-format
+msgid "Hue Groups - Edit group: %(name)s"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:53
+msgid "Hue Groups - Add/sync LDAP group"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:55
+msgid "Hue Groups - Create group"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:68
+msgid "Update group"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:71
+msgid "Add/Sync group"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:73
+#: src/useradmin/templates/list_groups.mako:32
+msgid "Add group"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:76
+#: src/useradmin/templates/edit_permissions.mako:56
+#: src/useradmin/templates/edit_user.mako:73
+#: src/useradmin/templates/list_users.mako:97
+msgid "Cancel"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:84
+#: src/useradmin/templates/edit_group.mako:89
+#: src/useradmin/templates/edit_permissions.mako:65
+#: src/useradmin/templates/edit_user.mako:80
+msgid "Select all"
+msgstr ""
+
+#: src/useradmin/templates/edit_group.mako:85
+#: src/useradmin/templates/edit_group.mako:90
+#: src/useradmin/templates/edit_permissions.mako:66
+#: src/useradmin/templates/edit_user.mako:81
+msgid "Search"
+msgstr ""
+
+#: src/useradmin/templates/edit_permissions.mako:23
+#: src/useradmin/templates/list_permissions.mako:25
+#: src/useradmin/templates/list_permissions.mako:29
+msgid "Hue Permissions"
+msgstr ""
+
+#: src/useradmin/templates/edit_permissions.mako:44
+#, python-format
+msgid "Hue Permissions - Edit app: %(app)s"
+msgstr ""
 
+#: src/useradmin/templates/edit_permissions.mako:55
+msgid "Update permission"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:24
+#: src/useradmin/templates/list_users.mako:24
+#: src/useradmin/templates/list_users.mako:28
+msgid "Hue Users"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:45
+#, python-format
+msgid "Hue Users - Edit user: %(username)s"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:50
+msgid "Hue Users - Add/sync LDAP user"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:52
+msgid "Hue Users - Create user"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:65
+msgid "Update user"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:68
+msgid "Add/Sync user"
+msgstr ""
+
+#: src/useradmin/templates/edit_user.mako:70
 #: src/useradmin/templates/list_users.mako:32
-msgid "First Name"
-msgstr "--First Name"
+msgid "Add user"
+msgstr ""
+
+#: src/useradmin/templates/layout.mako:32
+msgid "Users"
+msgstr ""
+
+#: src/useradmin/templates/layout.mako:33
+#: src/useradmin/templates/list_permissions.mako:40
+#: src/useradmin/templates/list_users.mako:48
+msgid "Groups"
+msgstr ""
+
+#: src/useradmin/templates/layout.mako:34
+#: src/useradmin/templates/list_groups.mako:45
+msgid "Permissions"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:33
+msgid "Add/Sync LDAP group"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:37
+#: src/useradmin/templates/list_permissions.mako:32
+#: src/useradmin/templates/list_users.mako:38
+msgid "Filter: "
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:37
+msgid "Search for group name, members, etc..."
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:43
+msgid "Group Name"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:44
+msgid "Members"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:60
+#, python-format
+msgid "Edit %(groupname)s"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:61
+#, python-format
+msgid "Delete %(groupname)s"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:63
+#: src/useradmin/templates/list_permissions.mako:54
+#: src/useradmin/templates/list_users.mako:68
+msgid "Edit"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:64
+#: src/useradmin/templates/list_users.mako:69
+msgid "Delete"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:78
+#: src/useradmin/templates/list_users.mako:107
+msgid "Confirm action"
+msgstr ""
+
+#: src/useradmin/templates/list_groups.mako:82
+#: src/useradmin/templates/list_users.mako:111
+msgid "No"
+msgstr ""
+
+#: src/useradmin/templates/list_permissions.mako:32
+msgid "Search for application name, description, etc..."
+msgstr ""
+
+#: src/useradmin/templates/list_permissions.mako:38
+msgid "Application"
+msgstr ""
+
+#: src/useradmin/templates/list_permissions.mako:39
+msgid "Permission"
+msgstr ""
+
+#: src/useradmin/templates/list_permissions.mako:54
+msgid "Edit permission"
+msgstr ""
 
 #: src/useradmin/templates/list_users.mako:33
-msgid "Last Name"
-msgstr "--Last Name"
+msgid "Add/sync LDAP user"
+msgstr ""
 
 #: src/useradmin/templates/list_users.mako:34
+msgid "Sync LDAP users/groups"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:38
+msgid "Search for username, name, e-mail, etc..."
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:44
+msgid "Username"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:45
+msgid "First Name"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:46
+msgid "Last Name"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:47
 msgid "E-mail"
-msgstr "--E-mail"
+msgstr ""
 
-#: src/useradmin/templates/list_users.mako:35
+#: src/useradmin/templates/list_users.mako:49
 msgid "Last Login"
 msgstr ""
 
+#: src/useradmin/templates/list_users.mako:64
+#, python-format
+msgid "Edit %(username)s"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:65
+#, python-format
+msgid "Delete %(username)s"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:86
+msgid "Sync LDAP users and groups"
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:90
+msgid ""
+"This will not import any users or groups that don't already exist in Hue."
+" Only users and groups imported from LDAP can be synced."
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:92
+msgid ""
+"All user information and group memberships will be updated based on the "
+"LDAP server's current state."
+msgstr ""
+
+#: src/useradmin/templates/list_users.mako:98
+msgid "Sync"
+msgstr ""
+

+ 0 - 40
apps/useradmin/src/useradmin/locale/it/LC_MESSAGES/django.po

@@ -1,40 +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-30 16:44-0800\n"
-"PO-Revision-Date: 2012-01-30 15:40-0800\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/useradmin/templates/list_users.mako:31
-msgid "Username"
-msgstr ""
-
-#: src/useradmin/templates/list_users.mako:32
-msgid "First Name"
-msgstr "New FIRST Nome"
-
-#: src/useradmin/templates/list_users.mako:33
-#, fuzzy
-msgid "Last Name"
-msgstr "New FIRST Nome"
-
-#: src/useradmin/templates/list_users.mako:34
-msgid "E-mail"
-msgstr ""
-
-#: src/useradmin/templates/list_users.mako:35
-msgid "Last Login"
-msgstr ""
-

+ 3 - 2
apps/useradmin/src/useradmin/templates/confirm.mako

@@ -15,13 +15,14 @@
 ## limitations under the License.
 <%!
 from desktop.views import commonheader, commonfooter
+from django.utils.translation import ugettext as _
 %>
 ${commonheader(title, "useradmin")}
 <div class="container-fluid">
-	<h1>Confirm</h1>
+	<h1>${_('Confirm')}</h1>
 	<form action="${path}" method="POST">
 		${title}
-		<input type="submit" value="Yes">
+		<input type="submit" value="${_('Yes')}">
 	</form>
 </div>
 ${commonfooter()}

+ 24 - 11
apps/useradmin/src/useradmin/templates/edit_group.mako

@@ -17,12 +17,14 @@
 from desktop.views import commonheader, commonfooter
 from desktop.lib.django_util import extract_field_data
 import urllib
+from django.utils.translation import ugettext as _
 %>
 
+
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader("Hue Users", "useradmin", "100px")}
-${layout.menubar(section='groups')}
+${commonheader(_('Hue Groups'), "useradmin", "100px")}
+${layout.menubar(section='groups', _=_)}
 
 <%def name="render_field(field)">
   %if not field.is_hidden:
@@ -42,12 +44,15 @@ ${layout.menubar(section='groups')}
 
 <div class="container-fluid">
 	% if name:
-		<h1>Hue Groups - Edit group: ${name}</h1>
+        <%
+            i18n_pageTitle = _('Hue Groups - Edit group: %(name)s') % {'name': name}
+        %>
+		<h1>${i18n_pageTitle}</h1>
 	% else:
 		% if ldap:
-			<h1>Hue Groups - Add/sync LDAP group</h1>
+			<h1>${_('Hue Groups - Add/sync LDAP group')}</h1>
 		% else:
-			<h1>Hue Groups - Create group</h1>
+			<h1>${_('Hue Groups - Create group')}</h1>
 		% endif
 	% endif
 
@@ -60,22 +65,30 @@ ${layout.menubar(section='groups')}
 		<br/>
 		<div class="form-actions">
 			% if name:
-				<input type="submit" class="btn btn-primary" value="Update group"/>
+				<input type="submit" class="btn btn-primary" value="${_('Update group')}"/>
 			% else:
 				% if ldap:
-					<input type="submit" class="btn btn-primary" value="Add/Sync group"/>
+					<input type="submit" class="btn btn-primary" value="${_('Add/Sync group')}"/>
 				% else:
-					<input type="submit" class="btn btn-primary" value="Add group"/>
+					<input type="submit" class="btn btn-primary" value="${_('Add group')}"/>
 				% endif
 			% endif
-			<a href="/useradmin/groups" class="btn">Cancel</a>
+			<a href="/useradmin/groups" class="btn">${_('Cancel')}</a>
 		</div>
 	</form>
 
 	<script type="text/javascript" charset="utf-8">
 		$(document).ready(function(){
-			$("#id_members").jHueSelector({width:400});
-			$("#id_permissions").jHueSelector({width:400});
+			$("#id_members").jHueSelector({
+                width:400,
+                selectAllLabel: "${_('Select all')}",
+                searchPlaceholder: "${_('Search')}"
+            });
+			$("#id_permissions").jHueSelector({
+                width:400,
+                selectAllLabel: "${_('Select all')}",
+                searchPlaceholder: "${_('Search')}"
+            });
 		});
 	</script>
 ${commonfooter()}

+ 16 - 7
apps/useradmin/src/useradmin/templates/edit_permissions.mako

@@ -15,11 +15,13 @@
 ## limitations under the License.
 <%!
 from desktop.views import commonheader, commonfooter
-import urllib %>
+import urllib
+from django.utils.translation import ugettext as _
+%>
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader("Hue Users", "useradmin", "100px")}
-${layout.menubar(section='permissions')}
+${commonheader(_('Hue Permissions'), "useradmin", "100px")}
+${layout.menubar(section='permissions', _=_)}
 
 
 <%def name="render_field(field)">
@@ -38,7 +40,10 @@ ${layout.menubar(section='permissions')}
 </%def>
 
 <div class="container-fluid">
-	<h1>Hue Permissions - Edit app: ${app}</h1>
+    <%
+        i18n_pageTitle = _('Hue Permissions - Edit app: %(app)s') % {'app': app}
+    %>
+	<h1>${i18n_pageTitle}</h1>
 	<form id="editForm" action="${urllib.quote(action)}" method="POST" class="form form-horizontal">
 		<fieldset>
 			% for field in form:
@@ -47,15 +52,19 @@ ${layout.menubar(section='permissions')}
 		</fieldset>
 		<br/>
 		<div class="form-actions">
-			<input type="submit" class="btn btn-primary" value="Update permission"/>
-			<a href="/useradmin/permissions" class="btn">Cancel</a>
+			<input type="submit" class="btn btn-primary" value="${_('Update permission')}"/>
+			<a href="/useradmin/permissions" class="btn">${_('Cancel')}</a>
 		</div>
 	</form>
 </div>
 
 <script type="text/javascript" charset="utf-8">
 	$(document).ready(function(){
-		$("#id_groups").jHueSelector({width:520});
+		$("#id_groups").jHueSelector({
+            width:520,
+            selectAllLabel: "${_('Select all')}",
+            searchPlaceholder: "${_('Search')}"
+        });
 	});
 </script>
 ${commonfooter()}

+ 19 - 11
apps/useradmin/src/useradmin/templates/edit_user.mako

@@ -16,11 +16,13 @@
 <%!
 from desktop.views import commonheader, commonfooter
 from desktop.lib.django_util import extract_field_data
-import urllib %>
+import urllib
+from django.utils.translation import ugettext as _
+%>
 <%namespace name="layout" file="layout.mako" />
 
-${commonheader("Hue Users", "useradmin", "100px")}
-${layout.menubar(section='users')}
+${commonheader(_('Hue Users'), "useradmin", "100px")}
+${layout.menubar(section='users', _=_)}
 
 <%def name="render_field(field)">
   %if not field.is_hidden:
@@ -39,12 +41,15 @@ ${layout.menubar(section='users')}
 
 <div class="container-fluid">
 	% if username:
-		<h1>Hue Users - Edit user: ${username}</h1>
+        <%
+            i18n_pageTitle = _('Hue Users - Edit user: %(username)s') % {'username': username}
+        %>
+		<h1>${i18n_pageTitle}</h1>
 	% else:
 		% if ldap:
-			<h1>Hue Users - Add/sync LDAP user</h1>
+			<h1>${_('Hue Users - Add/sync LDAP user')}</h1>
 		% else:
-			<h1>Hue Users - Create user</h1>
+			<h1>${_('Hue Users - Create user')}</h1>
 		% endif
 	% endif
 
@@ -57,21 +62,24 @@ ${layout.menubar(section='users')}
 		<br/>
 		<div class="form-actions">
 			% if username:
-				<input type="submit" class="btn btn-primary" value="Update user"/>
+				<input type="submit" class="btn btn-primary" value="${_('Update user')}"/>
 			% else:
 				% if ldap:
-					<input type="submit" class="btn btn-primary" value="Add/Sync user"/>
+					<input type="submit" class="btn btn-primary" value="${_('Add/Sync user')}"/>
 				% else:
-					<input type="submit" class="btn btn-primary" value="Add user"/>
+					<input type="submit" class="btn btn-primary" value="${_('Add user')}"/>
 				% endif
 			% endif
-			<a href="/useradmin/users" class="btn">Cancel</a>
+			<a href="/useradmin/users" class="btn">${_('Cancel')}</a>
 		</div>
 	</form>
 </div>
 <script type="text/javascript" charset="utf-8">
 	$(document).ready(function(){
-		$("#id_groups").jHueSelector();
+		$("#id_groups").jHueSelector({
+            selectAllLabel: "${_('Select all')}",
+            searchPlaceholder: "${_('Search')}"
+        });
 	});
 </script>
 ${commonfooter()}

+ 4 - 4
apps/useradmin/src/useradmin/templates/layout.mako

@@ -25,13 +25,13 @@ 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, 'users')}"><a href="/useradmin/users">Users</a></li>
-				<li class="${is_selected(section, 'groups')}"><a href="/useradmin/groups">Groups</a></li>
-				<li class="${is_selected(section, 'permissions')}"><a href="/useradmin/permissions">Permissions</a></li>
+				<li class="${is_selected(section, 'users')}"><a href="/useradmin/users">${_('Users')}</a></li>
+				<li class="${is_selected(section, 'groups')}"><a href="/useradmin/groups">${_('Groups')}</a></li>
+				<li class="${is_selected(section, 'permissions')}"><a href="/useradmin/permissions">${_('Permissions')}</a></li>
 			</ul>
 		</div>
 	</div>

+ 18 - 15
apps/useradmin/src/useradmin/templates/list_groups.mako

@@ -15,27 +15,26 @@
 ## limitations under the License.
 <%!
 from desktop.views import commonheader, commonfooter
+import urllib
+from django.utils.translation import ugettext as _
+from useradmin.models import group_permissions
 %>
-<% import urllib %>
-<% from django.utils.translation import ugettext, ungettext, get_language, activate %>
-<% from useradmin.models import group_permissions %>
-<% _ = ugettext %>
 
 <%namespace name="layout" file="layout.mako" />
-${commonheader("Hue Groups", "useradmin", "100px")}
-${layout.menubar(section='groups')}
+${commonheader(_('Hue Groups'), "useradmin", "100px")}
+${layout.menubar(section='groups', _=_)}
 
 <div class="container-fluid">
-    <h1>Hue Groups</h1>
+    <h1>${_('Hue Groups')}</h1>
     <div class="well hueWell">
         <div class="pull-right btn-group">
             %if user.is_superuser == True:
-            <a id="addGroupBtn" href="${url('useradmin.views.edit_group')}" class="btn">Add group</a>
-            <a id="addLdapGroupBtn" href="${url('useradmin.views.add_ldap_group')}" class="btn">Add/Sync LDAP group</a>
+            <a id="addGroupBtn" href="${url('useradmin.views.edit_group')}" class="btn">${_('Add group')}</a>
+            <a id="addLdapGroupBtn" href="${url('useradmin.views.add_ldap_group')}" class="btn">${_('Add/Sync LDAP group')}</a>
             %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-xlarge search-query" placeholder="${_('Search for group name, members, etc...')}">
         </form>
     </div>
     <table class="table table-striped datatables">
@@ -57,8 +56,12 @@ ${layout.menubar(section='groups')}
         <td>${', '.join([perm.app + "." + perm.action for perm in group_permissions(group)])}</td>
         %if user.is_superuser == True:
         <td class="right">
-          <a title="Edit ${group.name}" class="btn small editGroupBtn" href="${ url('useradmin.views.edit_group', name=urllib.quote(group.name)) }" data-row-selector="true">Edit</a>
-          <a title="Delete ${group.name}" class="btn small confirmationModal" alt="Are you sure you want to delete ${group.name}?" href="javascript:void(0)" data-confirmation-url="${ url('useradmin.views.delete_group', name=urllib.quote_plus(group.name)) }">Delete</a>
+          <%
+              i18n_editGroupname = _('Edit %(groupname)s') % {'groupname' : group.name}
+              i18n_deleteGroupname = _('Delete %(groupname)s') % {'groupname' : group.name}
+          %>
+          <a title="${i18n_editGroupname}" class="btn small editGroupBtn" href="${ url('useradmin.views.edit_group', name=urllib.quote(group.name)) }" data-row-selector="true">${_('Edit')}</a>
+          <a title="${i18n_deleteGroupname}" class="btn small confirmationModal" alt="Are you sure you want to delete ${group.name}?" href="javascript:void(0)" data-confirmation-url="${ url('useradmin.views.delete_group', name=urllib.quote_plus(group.name)) }">${_('Delete')}</a>
         </td>
         %endif
       </tr>
@@ -72,11 +75,11 @@ ${layout.menubar(section='groups')}
     <form id="deleteGroupForm" action="" method="POST">
     <div class="modal-header">
         <a href="#" class="close" data-dismiss="modal">&times;</a>
-        <h3 id="deleteGroupMessage">Confirm action</h3>
+        <h3 id="deleteGroupMessage">${_('Confirm action')}</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>

+ 9 - 10
apps/useradmin/src/useradmin/templates/list_permissions.mako

@@ -15,22 +15,21 @@
 ## limitations under the License.
 <%!
 from desktop.views import commonheader, commonfooter
+import urllib
+from django.utils.translation import ugettext as _
+from useradmin.models import group_permissions
+from django.contrib.auth.models import Group
 %>
-<% import urllib %>
-<% from django.utils.translation import ugettext, ungettext, get_language, activate %>
-<% from useradmin.models import group_permissions %>
-<% from django.contrib.auth.models import Group %>
-<% _ = ugettext %>
 
 <%namespace name="layout" file="layout.mako" />
-${commonheader("Hue Permissions", "useradmin", "100px")}
-${layout.menubar(section='permissions')}
+${commonheader(_('Hue Permissions'), "useradmin", "100px")}
+${layout.menubar(section='permissions', _=_)}
 
 <div class="container-fluid">
-    <h1>Hue Permissions</h1>
+    <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-xlarge search-query" placeholder="${_('Search for application name, description, etc...')}">
         </form>
     </div>
     <table class="table table-striped datatables">
@@ -52,7 +51,7 @@ ${layout.menubar(section='permissions')}
                 <td>${', '.join([group.name for group in Group.objects.filter(grouppermission__hue_permission=perm).order_by('name')])}</td>
             %if user.is_superuser:
                 <td class="right">
-                    <a title="Edit permission" class="btn small editPermissionBtn" href="${ url('useradmin.views.edit_permission', app=urllib.quote(perm.app), priv=urllib.quote(perm.action)) }" data-name="${perm.app}" data-row-selector="true">Edit</a>
+                    <a title="${_('Edit permission')}" class="btn small editPermissionBtn" href="${ url('useradmin.views.edit_permission', app=urllib.quote(perm.app), priv=urllib.quote(perm.action)) }" data-name="${perm.app}" data-row-selector="true">${_('Edit')}</a>
                 </td>
             %endif
             </tr>

+ 25 - 24
apps/useradmin/src/useradmin/templates/list_users.mako

@@ -17,26 +17,25 @@
 from desktop.views import commonheader, commonfooter
 from django.template.defaultfilters import date, time
 import urllib
-from django.utils.translation import ugettext, ungettext, get_language, activate
-_ = ugettext
+from django.utils.translation import ugettext as _
 %>
 
 <%namespace name="layout" file="layout.mako" />
-${commonheader("Hue Users", "useradmin", "100px")}
-${layout.menubar(section='users')}
+${commonheader(_('Hue Users'), "useradmin", "100px")}
+${layout.menubar(section='users', _=_)}
 
 <div class="container-fluid">
-    <h1>Hue Users</h1>
+    <h1>${_('Hue Users')}</h1>
     <div class="well hueWell">
         <div class="btn-group pull-right">
             %if user.is_superuser == True:
-            <a href="${ url('useradmin.views.edit_user') }" class="btn">Add user</a>
-            <a href="${ url('useradmin.views.add_ldap_user') }" class="btn">Add/sync LDAP user</a>
-            <a href="#syncLdap" class="btn" data-toggle="modal">Sync LDAP users/groups</a>
+            <a href="${ url('useradmin.views.edit_user') }" class="btn">${_('Add user')}</a>
+            <a href="${ url('useradmin.views.add_ldap_user') }" class="btn">${_('Add/sync LDAP user')}</a>
+            <a href="#syncLdap" class="btn" data-toggle="modal">${_('Sync LDAP users/groups')}</a>
             %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-xlarge search-query" placeholder="${_('Search for username, name, e-mail, etc...')}">
         </form>
     </div>
     <table class="table table-striped datatables">
@@ -61,12 +60,16 @@ ${layout.menubar(section='users')}
                 <td>${', '.join([group.name for group in listed_user.groups.all()])}</td>
                 <td>${date(listed_user.last_login)} ${time(listed_user.last_login).replace("p.m.","PM").replace("a.m.","AM")}</td>
                 <td class="right">
+                <%
+                    i18n_editUsername = _('Edit %(username)s') % {'username': listed_user.username}
+                    i18n_deleteUsername = _('Delete %(username)s') % {'username': listed_user.username}
+                %>
                 %if user.is_superuser == True:
-                    <a title="Edit ${listed_user.username}" class="btn small" href="${ url('useradmin.views.edit_user', username=urllib.quote(listed_user.username)) }" data-row-selector="true">Edit</a>
-                    <a title="Delete ${listed_user.username}" class="btn small confirmationModal" alt="Are you sure you want to delete ${listed_user.username}?" href="javascript:void(0)" data-confirmation-url="${ url('useradmin.views.delete_user', username=urllib.quote_plus(listed_user.username)) }">Delete</a>
+                    <a title="${i18n_editUsername}" class="btn small" href="${ url('useradmin.views.edit_user', username=urllib.quote(listed_user.username)) }" data-row-selector="true">${_('Edit')}</a>
+                    <a title="${i18n_deleteUsername}" class="btn small confirmationModal" alt="Are you sure you want to delete ${listed_user.username}?" href="javascript:void(0)" data-confirmation-url="${ url('useradmin.views.delete_user', username=urllib.quote_plus(listed_user.username)) }">${_('Delete')}</a>
                 %else:
                     %if user.username == listed_user.username:
-                        <a title="Edit ${listed_user.username}" class="btn small" href="${ url('useradmin.views.edit_user', username=urllib.quote(listed_user.username)) }">Edit</a>
+                        <a title="${i18n_editUsername}" class="btn small" href="${ url('useradmin.views.edit_user', username=urllib.quote(listed_user.username)) }">Edit</a>
                     %else:
                         &nbsp;
                     %endif
@@ -80,21 +83,19 @@ ${layout.menubar(section='users')}
     <div id="syncLdap" class="modal hide fade">
         <div class="modal-header">
             <button type="button" class="close" data-dismiss="modal">&times;</button>
-            <h3>Sync LDAP users and groups</h3>
+            <h3>${_('Sync LDAP users and groups')}</h3>
         </div>
         <div class="modal-body">
             <div class="alert alert-info">
-                This will not import any users or groups that don't already exist in Hue.
-                Only users and groups imported from LDAP can be synced.
+                ${_("This will not import any users or groups that don't already exist in Hue. Only users and groups imported from LDAP can be synced.")}
                 <br/>
-                All user information and group memberships will be updated based on the LDAP
-                server's current state.
+                ${_("All user information and group memberships will be updated based on the LDAP server's current state.")}
             </div>
         </div>
         <div class="modal-footer">
             <form action="${ url('useradmin.views.sync_ldap_users_groups') }" method="POST">
-                <a href="#" class="btn" data-dismiss="modal">Cancel</a>
-                <input type="submit" class="btn primary" value="Sync"/>
+                <a href="#" class="btn" data-dismiss="modal">${_('Cancel')}</a>
+                <input type="submit" class="btn primary" value="${_('Sync')}"/>
              </form>
         </div>
     </div>
@@ -103,11 +104,11 @@ ${layout.menubar(section='users')}
         <form id="deleteUserForm" action="" method="POST">
         <div class="modal-header">
             <a href="#" class="close" data-dismiss="modal">&times;</a>
-            <h3 id="deleteUserMessage">Confirm action</h3>
+            <h3 id="deleteUserMessage">${_('Confirm action')}</h3>
         </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>
@@ -126,7 +127,7 @@ ${layout.menubar(section='users')}
                         null,
                         null,
                         null,
-						{ "sType": "date" },
+                        { "sType": "date" },
                         { "bSortable": false }
                     ]
             });
@@ -152,7 +153,7 @@ ${layout.menubar(section='users')}
                 });
             });
 
-			$("a[data-row-selector='true']").jHueRowSelector();
+            $("a[data-row-selector='true']").jHueRowSelector();
         });
     </script>