[Checkins] SVN: zope.errorview/branches/jj-i18n/ Add i18n to errorviews.
Jan-Jaap Driessen
jdriessen at thehealthagency.com
Tue Jun 28 03:38:59 EDT 2011
Log message for revision 121999:
Add i18n to errorviews.
Changed:
U zope.errorview/branches/jj-i18n/buildout.cfg
U zope.errorview/branches/jj-i18n/src/zope/errorview/browser.py
U zope.errorview/branches/jj-i18n/src/zope/errorview/browser.zcml
A zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/
A zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/__init__.py
A zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/
A zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/en/
A zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/en/LC_MESSAGES/
A zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/en/LC_MESSAGES/zope.errorview.mo
A zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/en/LC_MESSAGES/zope.errorview.po
A zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/nl/
A zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/nl/LC_MESSAGES/
A zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/nl/LC_MESSAGES/zope.errorview.mo
A zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/nl/LC_MESSAGES/zope.errorview.po
A zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/zope.errorview.pot
U zope.errorview/branches/jj-i18n/src/zope/errorview/tests/ftesting.zcml
-=-
Modified: zope.errorview/branches/jj-i18n/buildout.cfg
===================================================================
--- zope.errorview/branches/jj-i18n/buildout.cfg 2011-06-28 07:38:10 UTC (rev 121998)
+++ zope.errorview/branches/jj-i18n/buildout.cfg 2011-06-28 07:38:59 UTC (rev 121999)
@@ -5,6 +5,7 @@
test
coverage-test
coverage-report
+ i18n
[test]
recipe = zc.recipe.testrunner
@@ -20,3 +21,14 @@
eggs = z3c.coverage
scripts = coverage=coverage-report
arguments = ('coverage', 'coverage/report')
+
+[i18n]
+recipe = z3c.recipe.i18n:i18n
+eggs =
+ zope.i18n
+ zope.errorview
+packages = zope.errorview
+domain = zope.errorview
+output = src/zope/errorview/i18n/locales
+zcml =
+ <include package="zope.i18n" file="meta.zcml" />
Modified: zope.errorview/branches/jj-i18n/src/zope/errorview/browser.py
===================================================================
--- zope.errorview/branches/jj-i18n/src/zope/errorview/browser.py 2011-06-28 07:38:10 UTC (rev 121998)
+++ zope.errorview/branches/jj-i18n/src/zope/errorview/browser.py 2011-06-28 07:38:59 UTC (rev 121999)
@@ -18,13 +18,14 @@
from zope.errorview.http import UnauthorizedView
from zope.publisher.browser import BrowserPage
-# XXX i18n-ing?
+from zope.errorview.i18n import _
+from zope.i18n import translate
-
class ExceptionView(ExceptionViewBase, BrowserPage):
def render(self):
- return u'A system error occurred.'
+ msg = _(u'A system error occurred.')
+ return translate(msg, context=self.request, default=msg)
class NotFoundView(ExceptionViewBase, BrowserPage):
@@ -33,7 +34,8 @@
self.request.response.setStatus(404)
def render(self):
- return u'The requested resource can not be found.'
+ msg = _(u'The requested resource can not be found.')
+ return translate(msg, context=self.request, default=msg)
class UnauthorizedView(UnauthorizedView, BrowserPage):
@@ -54,5 +56,6 @@
def render(self):
if self.request.response.getStatus() not in (302, 303):
- return u'Access to the requested resource is forbidden.'
+ msg = _(u'Access to the requested resource is forbidden.')
+ return translate(msg, context=self.request, default=msg)
return ''
Modified: zope.errorview/branches/jj-i18n/src/zope/errorview/browser.zcml
===================================================================
--- zope.errorview/branches/jj-i18n/src/zope/errorview/browser.zcml 2011-06-28 07:38:10 UTC (rev 121998)
+++ zope.errorview/branches/jj-i18n/src/zope/errorview/browser.zcml 2011-06-28 07:38:59 UTC (rev 121999)
@@ -1,9 +1,13 @@
<configure
xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser">
+ xmlns:browser="http://namespaces.zope.org/browser"
+ xmlns:i18n="http://namespaces.zope.org/i18n"
+ i18n_domain="zope.errorview">
<include package="zope.browserpage" file="meta.zcml" />
<include package="." file="http.zcml" />
+
+ <i18n:registerTranslations directory="i18n/locales" />
<browser:page
for="zope.interface.common.interfaces.IException"
Added: zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/__init__.py
===================================================================
--- zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/__init__.py (rev 0)
+++ zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/__init__.py 2011-06-28 07:38:59 UTC (rev 121999)
@@ -0,0 +1,15 @@
+##############################################################################
+#
+# Copyright (c) 2011 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+from zope.i18nmessageid import MessageFactory
+_ = MessageFactory('zope.errorview')
Added: zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/en/LC_MESSAGES/zope.errorview.mo
===================================================================
(Binary files differ)
Property changes on: zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/en/LC_MESSAGES/zope.errorview.mo
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/en/LC_MESSAGES/zope.errorview.po
===================================================================
--- zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/en/LC_MESSAGES/zope.errorview.po (rev 0)
+++ zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/en/LC_MESSAGES/zope.errorview.po 2011-06-28 07:38:59 UTC (rev 121999)
@@ -0,0 +1,37 @@
+##############################################################################
+#
+# Copyright (c) 2011 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+msgid ""
+msgstr ""
+"Project-Id-Version: Meaningless\n"
+"POT-Creation-Date: Fri Jun 24 07:59:16 2011\n"
+"PO-Revision-Date: 2011-06-24 O7:59+CET\n"
+"Last-Translator: Jan-Jaap Driessen <janjaapdriessen at gmail.com>\n"
+"Language-Team: Zope 3 Developers <zope-dev at zope.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: zope/app/locales/extract.py\n"
+
+#: zope/errorview/browser.py:26
+msgid "A system error occurred."
+msgstr "A system error occurred."
+
+#: zope/errorview/browser.py:35
+msgid "The requested resource can not be found."
+msgstr "The requested resource can not be found."
+
+#: zope/errorview/browser.py:56
+msgid "Access to the requested resource is forbidden."
+msgstr "Access to the requested resource is forbidden."
+
Added: zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/nl/LC_MESSAGES/zope.errorview.mo
===================================================================
(Binary files differ)
Property changes on: zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/nl/LC_MESSAGES/zope.errorview.mo
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/nl/LC_MESSAGES/zope.errorview.po
===================================================================
--- zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/nl/LC_MESSAGES/zope.errorview.po (rev 0)
+++ zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/nl/LC_MESSAGES/zope.errorview.po 2011-06-28 07:38:59 UTC (rev 121999)
@@ -0,0 +1,37 @@
+##############################################################################
+#
+# Copyright (c) 2011 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+msgid ""
+msgstr ""
+"Project-Id-Version: Meaningless\n"
+"POT-Creation-Date: Fri Jun 24 07:59:16 2011\n"
+"PO-Revision-Date: 2011-06-24 O7:59+CET\n"
+"Last-Translator: Jan-Jaap Driessen <janjaapdriessen at gmail.com>\n"
+"Language-Team: Zope 3 Developers <zope-dev at zope.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: zope/app/locales/extract.py\n"
+
+#: zope/errorview/browser.py:26
+msgid "A system error occurred."
+msgstr "Er is een systeem fout opgetreden."
+
+#: zope/errorview/browser.py:35
+msgid "The requested resource can not be found."
+msgstr "De opgevraagde pagina kan niet worden gevonden."
+
+#: zope/errorview/browser.py:56
+msgid "Access to the requested resource is forbidden."
+msgstr "Toegang geweigerd."
+
Added: zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/zope.errorview.pot
===================================================================
--- zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/zope.errorview.pot (rev 0)
+++ zope.errorview/branches/jj-i18n/src/zope/errorview/i18n/locales/zope.errorview.pot 2011-06-28 07:38:59 UTC (rev 121999)
@@ -0,0 +1,37 @@
+##############################################################################
+#
+# Copyright (c) 2011 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+msgid ""
+msgstr ""
+"Project-Id-Version: Meaningless\n"
+"POT-Creation-Date: Mon Jun 27 11:18:10 2011\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: Zope 3 Developers <zope-dev at zope.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: zope/app/locales/extract.py\n"
+
+#: zope/errorview/browser.py:26
+msgid "A system error occurred."
+msgstr "A system error occurred."
+
+#: zope/errorview/browser.py:35
+msgid "The requested resource can not be found."
+msgstr "The requested resource can not be found."
+
+#: zope/errorview/browser.py:56
+msgid "Access to the requested resource is forbidden."
+msgstr "Access to the requested resource is forbidden."
+
Modified: zope.errorview/branches/jj-i18n/src/zope/errorview/tests/ftesting.zcml
===================================================================
--- zope.errorview/branches/jj-i18n/src/zope/errorview/tests/ftesting.zcml 2011-06-28 07:38:10 UTC (rev 121998)
+++ zope.errorview/branches/jj-i18n/src/zope/errorview/tests/ftesting.zcml 2011-06-28 07:38:59 UTC (rev 121999)
@@ -2,6 +2,15 @@
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser">
+ <include package="zope.component" file="meta.zcml"/>
+ <include package="zope.security" file="meta.zcml"/>
+ <include package="zope.i18n" file="meta.zcml"/>
+
+ <include package="zope.component"/>
+ <include package="zope.security"/>
+ <include package="zope.publisher"/>
+ <include package="zope.i18n"/>
+
<include package="zope.errorview" file="browser.zcml" />
<utility
More information about the checkins
mailing list