[Zope3-checkins] CVS: Zope3/src/zope/app/browser/security -
configure.zcml:1.6 permissionwidget.py:1.10
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu Aug 7 14:42:27 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/browser/security
In directory cvs.zope.org:/tmp/cvs-serv26029/security
Modified Files:
configure.zcml permissionwidget.py
Log Message:
Internationalized the rest of zope/app/browser.
I also took the chance to clean up some old code and remove a lot of cruft.
(This is the reason I decided to do it instead of letting a less
experienced developer do it.)
I now consider I18n of the Zope core done. What does this mean to you?
1. All code you check into the CVS must be internationalized. That means:
(a) Python and PT code must be properly tagged.
(b) zope.pot must be updated. This can be done with::
[zope/app/translation_files]$ python extract.py
Note: You do not need to merge the new POT file with the catalogs.
2. Any code snippet that has no I18n is considered a bug! Therefore, please
take care and do the I18n and make code so when you see missing spots.
Finally I would like to mention that some forms might experience some
hickups, as I changed and moved around a lot of templates and was not able
to verify them all by hand. Please let me know, if something that used to
work is not working anymore.
=== Zope3/src/zope/app/browser/security/configure.zcml 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/security/configure.zcml:1.5 Sun Aug 3 13:49:22 2003
+++ Zope3/src/zope/app/browser/security/configure.zcml Thu Aug 7 13:40:53 2003
@@ -1,21 +1,16 @@
-<configure
- xmlns="http://namespaces.zope.org/browser"
- i18n_domain='zope'
- >
+<configure xmlns="http://namespaces.zope.org/browser">
<page
for="zope.app.interfaces.security.IPermissionField"
name="edit"
class=".permissionwidget.SinglePermissionWidget"
- permission="zope.Public"
- />
+ permission="zope.Public" />
<page
for="zope.app.interfaces.security.IPermissionField"
name="display"
class=".permissionwidget.DisplayWidget"
- permission="zope.Public"
- />
+ permission="zope.Public" />
<include package=".grants" />
=== Zope3/src/zope/app/browser/security/permissionwidget.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/browser/security/permissionwidget.py:1.9 Wed Apr 30 19:37:54 2003
+++ Zope3/src/zope/app/browser/security/permissionwidget.py Thu Aug 7 13:40:53 2003
@@ -15,11 +15,11 @@
$Id$
"""
-
from zope.app.browser.form import widget
from zope.component import getService
-from zope.app.services.servicenames import Permissions
+from zope.app.services.servicenames import Permissions, Translation
from zope.security.checker import CheckerPublic
+from zope.app.i18n import ZopeMessageIDFactory as _
class BaseWidget:
@@ -34,9 +34,7 @@
permission_id = permission_id.encode('ascii')
except UnicodeError, v:
raise ConversionError("Invalid textual data", v)
-
-
if permission_id == 'zope.Public':
permission_id = CheckerPublic
@@ -64,7 +62,11 @@
select_name = self.name
selected = self._showData()
- options = ['<option value=\"\">---select permission---</option>']
+ ts = getService(self.context.context, Translation)
+ sel_perm = _('---select permission---')
+ sel_perm = ts.translate(sel_perm, "zope")
+
+ options = ['<option value=\"\">'+sel_perm+'</option>']
for permission in permissions:
options.append('<option value="%s"%s>%s</option>'
% (permission,
More information about the Zope3-Checkins
mailing list