[Zope3-checkins] CVS: Zope3/src/zope/app/pagetemplate - engine.py:1.6

Stephan Richter srichter@cbu.edu
Tue, 25 Mar 2003 15:07:17 -0500


Update of /cvs-repository/Zope3/src/zope/app/pagetemplate
In directory cvs.zope.org:/tmp/cvs-serv23881/src/zope/app/pagetemplate

Modified Files:
	engine.py 
Log Message:
Finally got LocalTranslationService hooked up to TAL! Yeah!


=== Zope3/src/zope/app/pagetemplate/engine.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/pagetemplate/engine.py:1.5	Mon Dec 30 22:35:08 2002
+++ Zope3/src/zope/app/pagetemplate/engine.py	Tue Mar 25 15:07:16 2003
@@ -28,8 +28,8 @@
      import ExpressionEngine, RegistrationError, Context
 
 from zope.app.interfaces.traversing import ITraverser
+from zope.component import getService
 from zope.app.traversing.adapters import Traverser
-from zope.i18n.globaltranslationservice import translationService
 from zope.proxy.introspection import removeAllProxies
 from zope.security.proxy import ProxyFactory
 from zope.security.builtins import RestrictedBuiltins
@@ -63,8 +63,8 @@
         return macro
 
     def translate(self, domain, msgid, mapping):
-        return translationService.translate(domain, msgid, mapping,
-                                            self.request)
+        ts = getService(self.context, 'Translation')
+        return ts.translate(domain, msgid, mapping, self.request)
 
 
 class ZopeEngine(ExpressionEngine):
@@ -81,6 +81,11 @@
         # Put request into context so path traversal can find it
         if 'request' in namespace:
             context.request = namespace['request']
+
+        # Put context into context so path traversal can find it
+        # XXX: Change to container once the renaming has been done!
+        if 'context' in namespace:
+            context.context = namespace['context']
 
         return context