]> CRI, Mines Paris - PSL - Portfolio.git/blobdiff - utils.py
Compatibilité minimum pour que zope se lance.
[Portfolio.git] / utils.py
index 1fee07f4843fcdc065e90a2b5e5bf24fc24b3e3a..26ed830559522154c49a5a9c177f6249130c0d29 100755 (executable)
--- 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 Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService
 from zope.i18nmessageid import MessageFactory
 
 security = ModuleSecurityInfo('Products.Portfolio.utils')
@@ -26,10 +24,12 @@ security.declarePublic('translate')
 def translate(message, context):
        """ Translate i18n message.
        """
-       GTS = getGlobalTranslationService()
+       # 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)