X-Git-Url: https://svn.cri.ensmp.fr/git/Portfolio.git/blobdiff_plain/2d47c9c3dc8e8265381e167514626f854a2a6f2b..174995bb4169e32216998895a17afb2097cd64ab:/utils.py?ds=sidebyside diff --git a/utils.py b/utils.py index 4ee5520..fe5f6d1 100755 --- a/utils.py +++ b/utils.py @@ -12,7 +12,7 @@ """ from AccessControl import ModuleSecurityInfo -from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService +from zope.i18n import translate as i18ntranslate from zope.i18nmessageid import MessageFactory security = ModuleSecurityInfo('Products.Portfolio.utils') @@ -24,10 +24,9 @@ security.declarePublic('translate') def translate(message, context): """ Translate i18n message. """ - GTS = getGlobalTranslationService() if isinstance(message, Exception): try: message = message[0] except (TypeError, IndexError): pass - return GTS.translate('portfolio', message, context=context) + return i18ntranslate(message, domain='portfolio', context=context.REQUEST)