[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/ New translation slots added

Dmitry Vasiliev dima at hlabs.spb.ru
Fri Jun 24 06:59:31 EDT 2005


Log message for revision 30904:
  New translation slots added
  

Changed:
  U   Zope3/trunk/src/zope/app/authentication/browser/schemasearch.py
  U   Zope3/trunk/src/zope/app/securitypolicy/browser/granting.py

-=-
Modified: Zope3/trunk/src/zope/app/authentication/browser/schemasearch.py
===================================================================
--- Zope3/trunk/src/zope/app/authentication/browser/schemasearch.py	2005-06-24 10:56:45 UTC (rev 30903)
+++ Zope3/trunk/src/zope/app/authentication/browser/schemasearch.py	2005-06-24 10:59:31 UTC (rev 30904)
@@ -21,13 +21,15 @@
 from zope.i18n import translate
 from zope.schema import getFieldsInOrder
 from zope.app.zapi import getName, getPath
-from zope.app.authentication.interfaces import IQuerySchemaSearch
 from zope.app.form.utility import setUpWidgets, getWidgetsData
 from zope.app.form.interfaces import IInputWidget
 from zope.app.form.browser.interfaces import ISourceQueryView
 from zope.app.i18n import ZopeMessageIDFactory as _
 
+
 search_label = _('search-button', 'Search')
+source_label = _(u"Source path")
+source_title = _(u"Path to the source utility")
 
 class QuerySchemaSearchView(object):
     implements(ISourceQueryView)
@@ -51,8 +53,8 @@
         
         # for each source add path of source
         html.append('  <div class="label">')
-        label = _(u"Source path")
-        title = _(u"Path to the source utility")
+        label = translate(source_label, context=self.request)
+        title = translate(source_title, context=self.request)
         html.append('    <label for="%s" title="%s">' % (sourcename, title))
         html.append('      %s' % label)
         html.append('    </label>')
@@ -69,7 +71,7 @@
         for field_name, field in getFieldsInOrder(schema):
             widget = getattr(self, field_name+'_widget')
             
-            # for each field add lable...
+            # for each field add label...
             html.append('  <div class="label">')
             html.append('    <label for="%s" title="%s">'
                         % (widget.name, widget.hint))

Modified: Zope3/trunk/src/zope/app/securitypolicy/browser/granting.py
===================================================================
--- Zope3/trunk/src/zope/app/securitypolicy/browser/granting.py	2005-06-24 10:56:45 UTC (rev 30903)
+++ Zope3/trunk/src/zope/app/securitypolicy/browser/granting.py	2005-06-24 10:59:31 UTC (rev 30904)
@@ -16,8 +16,9 @@
 $Id$
 """
 __docformat__ = "reStructuredText"
+
 import zope.schema
-from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
+from zope.schema.vocabulary import SimpleTerm
 from zope.app import zapi
 from zope.app.security.vocabulary import PrincipalSource
 from zope.app.form.utility import setUpWidget
@@ -33,6 +34,7 @@
 from zope.app.security.interfaces import IPermission
 from zope.app.security import settings
 
+
 settings_vocabulary = GrantVocabulary(
     [SimpleTerm(settings.Allow, token="allow", title=_('Allow')),
      SimpleTerm(settings.Unset, token="unset", title=_('Unset')),
@@ -42,12 +44,12 @@
 
 class GrantWidget(RadioWidget):
     """Garnt widget for build a colorized matrix.
-    
+
     The matrix shows anytime the status if you edit the radio widgets.
     This special widget shows the radio input field without labels.
     The labels are added in the header of the table. The order of the radio
     input fields is 'Allowed', 'Unset', 'Deny'.
-    
+
     """
     orientation = "horizontal"
     _tdTemplate = u'\n<td class="%s">\n<center>\n<label for="%s" title="%s">\n%s\n</label>\n</center>\n</td>\n'
@@ -63,14 +65,14 @@
 
     def renderItem(self, index, text, value, name, cssClass):
         """Render an item of the list. 
-        
-        Revert the order of label and text. Added field id to the lable 
+
+        Revert the order of label and text. Added field id to the lable
         attribute.
-        
+
         Added tabel td tags for fit in the matrix table.
-        
+
         """
-        
+
         tdClass = ''
         id = '%s.%s' % (name, index)
         elem = renderElement(u'input',
@@ -84,8 +86,8 @@
 
     def renderSelectedItem(self, index, text, value, name, cssClass):
         """Render a selected item of the list. 
-        
-        Revert the order of label and text. Added field id to the lable 
+
+        Revert the order of label and text. Added field id to the lable
         attribute.
         """
 
@@ -145,7 +147,7 @@
         setUpWidget(self, 'principal', self.principal_field, IInputWidget)
         if not self.principal_widget.hasInput():
             return u''
-        
+
         principal = self.principal_widget.getInputValue()
         self.principal = principal
 
@@ -186,7 +188,7 @@
 
         if 'GRANT_SUBMIT' not in self.request:
             return u''
-        
+
         for role in roles:
             name = principal_token + '.role.'+role.id
             role_widget = getattr(self, name+'_widget')
@@ -202,7 +204,7 @@
                 else:
                     principal_roles.unsetRoleForPrincipal(
                         role.id, principal)
-        
+
         for perm in perms:
             if perm.id == 'zope.Public':
                 continue
@@ -220,5 +222,5 @@
                 else:
                     principal_perms.unsetPermissionForPrincipal(
                         perm.id, principal)
-                    
-        return u'Grants updated.'
+
+        return _('Grants updated.')



More information about the Zope3-Checkins mailing list