clean up

parent e1d05930
...@@ -11,18 +11,17 @@ ...@@ -11,18 +11,17 @@
# #
############################################################################## ##############################################################################
from GlobalTranslationService import getGlobalTranslationService
from zope.tales.tales import ExpressionEngine from zope.tales.tales import ExpressionEngine
from zope.tales.expressions import PathExpr, StringExpr, NotExpr, DeferExpr, SubPathExpr from zope.tales.expressions import PathExpr, StringExpr, NotExpr
from zope.tales.expressions import SimpleModuleImporter, _marker from zope.tales.expressions import DeferExpr, SubPathExpr
from zope.tales.expressions import SimpleModuleImporter
from zope.tales.pythonexpr import PythonExpr from zope.tales.pythonexpr import PythonExpr
from zope.tales.tales import _valid_name, _parse_expr, NAME_RE, Undefined, Context from zope.tales.tales import _valid_name, _parse_expr, NAME_RE, Undefined, Context
from zope.i18n import translate from zope.i18n import translate
GTS = getGlobalTranslationService() from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService
_marker = object()
def BoboTraverseAwareSimpleTraverse(object, path_items, econtext): def BoboTraverseAwareSimpleTraverse(object, path_items, econtext):
""" a slightly modified version of zope.tales.expressions.simpleTraverse() """ a slightly modified version of zope.tales.expressions.simpleTraverse()
...@@ -68,9 +67,9 @@ class PathExpr(PathExpr): ...@@ -68,9 +67,9 @@ class PathExpr(PathExpr):
class Context(Context): class Context(Context):
def translate(self, msgid, domain=None, mapping=None, default=None): def translate(self, msgid, domain=None, mapping=None, default=None):
return GTS.translate(msgid, domain, mapping, return getGlobalTranslationService().translate(
msgid, domain, mapping,
context=self.contexts['context'], default=default) context=self.contexts['context'], default=default)
def translate(self, domain, msgid, mapping=None, def translate(self, domain, msgid, mapping=None,
...@@ -108,4 +107,3 @@ def Engine(): ...@@ -108,4 +107,3 @@ def Engine():
return e return e
Engine = Engine() Engine = Engine()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment