X-Git-Url: https://scm.cri.ensmp.fr/git/Portfolio.git/blobdiff_plain/011a53d5681ad1f5fa88a534ec041c93d3e7be95..refs/heads/zope-2.13:/utils.py diff --git a/utils.py b/utils.py index 1fee07f..fe5f6d1 100755 --- a/utils.py +++ b/utils.py @@ -9,12 +9,10 @@ # http://creativecommons.org/licenses/by-nc/2.0/ # ############################################################ """ Global utilities for portfolio / photo objects. -$Id: utils.py 1200 2009-07-08 15:50:15Z pin $ -$URL: http://svn.luxia.fr/svn/labo/projects/zope/Portfolio/trunk/utils.py $ """ 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') @@ -26,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)