X-Git-Url: https://scm.cri.ensmp.fr/git/Portfolio.git/blobdiff_plain/b14b0bd922e6ebf247d8ead6e8a27bc9730b02a6..7d1d5b450a86762cd8dceb6a2e15eafa6231a755:/utils.py diff --git a/utils.py b/utils.py index 26ed830..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,12 +24,9 @@ security.declarePublic('translate') def translate(message, context): """ Translate i18n message. """ - # TODO: touver une solution. - # GTS = getGlobalTranslationService() if isinstance(message, Exception): try: message = message[0] except (TypeError, IndexError): pass - return message - return GTS.translate('portfolio', message, context=context) + return i18ntranslate(message, domain='portfolio', context=context.REQUEST)