Hi everyone,
I'm trying to call some i18n ZPT to generate mails in different languages
from a python External method.
Does anybody know hot to set the target_language of a template being called
from python code?
For the moment I succeeded doing:
def mailGenerator(self):
request = self.REQUEST
form = {'language':'fr'}
request.form = form
body=self.mail_templates.mail_template1(self, var1=foo, var2=bar)
return body
which returns mail_template1 in french
but when I try
def mailGenerator(self):
request = self.REQUEST
form = {'language':'fr'}
request.form = form
body=self.mail_templates.mail_template1(self, var1=foo, var2=bar)
form = {'language':'en'}
request.form = form
body = body + self.mail_templates.mail_template1(self, var1=foo,
var2=bar)
return body
I get both mail_templates in the same language, instead of getting the
second one in English.
The environment I'm working on is Zope 2.10 and PlacelessTranslationService
1.4.12
Any ideas?
Thank you in advance,
Toni.
_______________________________________________
ZPT mailing list
[email protected]
http://mail.zope.org/mailman/listinfo/zpt