+# -*- coding: utf-8 -*-
#######################################################################################
# Plinn - http://plinn.org #
# Copyright (C) 2005-2007 BenoƮt PIN <benoit.pin@ensmp.fr> #
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
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