Use ztfy.utils "text:translate" TAL adapter to display status ZTK-1.1
authorThierry Florac <tflorac@ulthar.net>
Sat, 31 Mar 2012 01:29:05 +0200
branchZTK-1.1
changeset 136 aab380e3c821
parent 135 864a0cee13c0
child 137 8e70a18787e1
Use ztfy.utils "text:translate" TAL adapter to display status
ztfy/utils/tal/interfaces.py
ztfy/utils/tal/text.py
--- a/ztfy/utils/tal/interfaces.py	Thu Mar 29 19:18:44 2012 +0200
+++ b/ztfy/utils/tal/interfaces.py	Sat Mar 31 01:29:05 2012 +0200
@@ -46,6 +46,9 @@
     def breaks():
         """Replace '|' by newlines in adapted text"""
 
+    def translate():
+        """Use I18n translation of given text"""
+
 
 class IHTMLTalesAPI(Interface):
     """'html' TALES namespace interface"""
--- a/ztfy/utils/tal/text.py	Thu Mar 29 19:18:44 2012 +0200
+++ b/ztfy/utils/tal/text.py	Sat Mar 31 01:29:05 2012 +0200
@@ -24,6 +24,7 @@
 from ztfy.utils.tal.interfaces import ITextStartTalesAPI, ITextOutputTalesAPI
 
 # import Zope3 packages
+from zope.i18n import translate
 from zope.interface import implements
 
 # import local packages
@@ -70,3 +71,6 @@
 
     def breaks(self):
         return self.context.replace('|', '\n')
+
+    def translate(self):
+        return translate(self.context, context=self.request)