From fbcbbb59f3bf16d329c9cf9b1295eaeb15ae040e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Pin?= Date: Tue, 26 Oct 2010 16:19:07 +0200 Subject: [PATCH 1/1] =?utf8?q?R=C3=A9solu=20:=20probl=C3=A8me=20de=20local?= =?utf8?q?isation=20avec=20zope-2.12.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/utils.py b/utils.py index 3344d57..68b8c46 100755 --- a/utils.py +++ b/utils.py @@ -17,7 +17,7 @@ $URL: http://svn.luxia.fr/svn/labo/projects/zope/photoprint/trunk/utils.py $ from AccessControl import ModuleSecurityInfo # TODO: trouver une solution… -#from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService +from zope.i18n import translate as i18ntranslate from zope.i18nmessageid import MessageFactory security = ModuleSecurityInfo('Products.photoprint.utils') @@ -32,8 +32,7 @@ def translate(message, context): message = message[0] except (TypeError, IndexError): pass - return message - return GTS.translate('photoprint', message, context=context) + return i18ntranslate(message, domain='photoprint', context=context.REQUEST) security.declarePublic('Message') Message = _ = MessageFactory('photoprint') -- 2.20.1