[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/securitypolicy/browser/ Added translation slots

Dmitry Vasiliev dima at hlabs.spb.ru
Thu Jul 28 03:42:19 EDT 2005


Log message for revision 37525:
  Added translation slots
  

Changed:
  U   Zope3/trunk/src/zope/app/securitypolicy/browser/manage_access.pt
  U   Zope3/trunk/src/zope/app/securitypolicy/browser/rolepermissionview.py

-=-
Modified: Zope3/trunk/src/zope/app/securitypolicy/browser/manage_access.pt
===================================================================
--- Zope3/trunk/src/zope/app/securitypolicy/browser/manage_access.pt	2005-07-28 04:15:38 UTC (rev 37524)
+++ Zope3/trunk/src/zope/app/securitypolicy/browser/manage_access.pt	2005-07-28 07:42:18 UTC (rev 37525)
@@ -1,13 +1,8 @@
 <html metal:use-macro="context/@@standard_macros/dialog" i18n:domain="zope">
 <head>
   <tal:block
-      metal:fill-slot="headers" 
-      tal:define="global pagetip string:
-      For each permission you want to grant (or deny) to a role, 
-      set the entry for that permission and role to a '+' (or '-').
-      Permissions are shown on the left side, going down.
-      Roles are shown accross the top.
-      "
+      metal:fill-slot="headers"
+      tal:define="global pagetip view/pagetip"
       />
 </head>
 <body>
@@ -41,7 +36,7 @@
           <div class="list-item">
             <a href="RolePermissions.html"
               tal:attributes="
-              href string:RolePermissions.html?role_to_manage=${role/id}" 
+              href string:RolePermissions.html?role_to_manage=${role/id}"
               tal:content="role/title" i18n:translate="">Anonymous</a>
             <input type="hidden" name="r0" value=""
               tal:attributes="
@@ -86,7 +81,7 @@
       <tr>
         <td colspan="5" align="left">
           <div class="form-element">
-            <input class="form-element" type="submit" name="SUBMIT" 
+            <input class="form-element" type="submit" name="SUBMIT"
                    value="Save Changes" i18n:attributes="value" />
           </div>
         </td>

Modified: Zope3/trunk/src/zope/app/securitypolicy/browser/rolepermissionview.py
===================================================================
--- Zope3/trunk/src/zope/app/securitypolicy/browser/rolepermissionview.py	2005-07-28 04:15:38 UTC (rev 37524)
+++ Zope3/trunk/src/zope/app/securitypolicy/browser/rolepermissionview.py	2005-07-28 07:42:18 UTC (rev 37525)
@@ -29,6 +29,15 @@
 
 class RolePermissionView(object):
 
+    _pagetip = _("""For each permission you want to grant (or deny) to a role,
+        set the entry for that permission and role to a '+' (or '-').
+        Permissions are shown on the left side, going down.
+        Roles are shown accross the top.
+        """)
+
+    def pagetip(self):
+        return translate(self._pagetip, context=self.request)
+
     def roles(self):
         roles = getattr(self, '_roles', None)
         if roles is None:
@@ -134,11 +143,11 @@
             for permission in self.permissions():
                 rperm = permission.id
                 if rperm in allowed and rperm in denied:
-                    raise UserError(
-                        'You choose both allow and deny for permission "%s". '
-                        'This is not allowed.'
-                        % translate(permission.title, context=self.request)
-                        )
+                    msg = _('You choose both allow and deny for permission'
+                        ' "${permission}". This is not allowed.')
+                    msg.mapping = {'permission': translate(
+                        permission.title, context=self.request)}
+                    raise UserError(msg)
                 if rperm in allowed:
                     prm.grantPermissionToRole(rperm, role_id)
                 elif rperm in denied:



More information about the Zope3-Checkins mailing list