X-Git-Url: https://svn.cri.mines-paristech.fr/git/Plinn.git/blobdiff_plain/3e0a2c257d49fb162da9c70d2f70194036235166..8c0cc609dae0b183c30cb17c66deb3e8af6b0fc4:/utils.py

diff --git a/utils.py b/utils.py
index a2586c4..14097e4 100755
--- a/utils.py
+++ b/utils.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 #######################################################################################
 #   Plinn - http://plinn.org                                                          #
 #   Copyright (C) 2005-2007  Benoît PIN <benoit.pin@ensmp.fr>                         #
@@ -35,7 +36,7 @@ from Products.CMFCore.utils import getToolByName, getUtilityByInterfaceName
 from Products.CMFCore.exceptions import BadRequest
 from Products.Utf8Splitter.Utf8Splitter import Utf8Utils
 from Globals import REPLACEABLE, NOT_REPLACEABLE, UNIQUE
-from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService
+from zope.i18n import translate as i18ntranslate
 from zope.i18n.interfaces import IUserPreferredLanguages
 from zope.i18nmessageid import MessageFactory
 from zope.component.interfaces import ComponentLookupError
@@ -194,13 +195,12 @@ 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('plinn', message, context=context)
+	return i18ntranslate(message, domain='plinn', context=context.REQUEST)
 
 security.declarePublic('desacc')
 desacc = Utf8Utils.desacc