--- 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)