Actually -- for a more proper solution -- I believe zope.i18n.interfaces.IUserPreferredLanguages is expected to adapt a request (rather than being a contextless utility) so I bet you could register a custom IUserPreferredLanguages whose getPreferredLanguages returns [&#39;fr&#39;] on an IForceLanguage interface, and mark the current request with IForceLanguage before rendering the template.<br>
<br>egj<br><br><div class="gmail_quote">On Fri, Apr 17, 2009 at 3:35 PM, Ethan Jucovy <span dir="ltr">&lt;<a href="mailto:ethan.jucovy@gmail.com">ethan.jucovy@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
How about just monkeypatching the active negotiator?<br><br>{{{<br>negotiator = getUtility(zope.i18n.interfaces.INegotiator)<br>orig = negotiator.getLanguage<br>negotiator.getLanguage = lambda foo, bar: &#39;fr&#39;<br>text = my_page_template()<br>

negotiator.getLanguage = orig<br>}}}<br><br>Haven&#39;t tested it, but in my (limited) understanding of the I18N system something like that ought to work..<br><br>egj<div><div></div><div class="h5"><br><br><div class="gmail_quote">
On Fri, Apr 17, 2009 at 3:14 PM, Chris Withers <span dir="ltr">&lt;<a href="mailto:chris@simplistix.co.uk" target="_blank">chris@simplistix.co.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi All,<br>
<br>
What I want to do is best shown in pseudocode:<br>
<br>
something.setLanguage(&#39;fr&#39;)<br>
text = my_page_template()<br>
something.restoreLanguage()<br>
<br>
...the reason I want to do this is that the results of that template<br>
will not be in the language negotiated for the current user, as the<br>
result is then emailed to someone who may not be speaking the same<br>
language as them.<br>
<br>
I can&#39;t find a way to specify a target_language that overrides the<br>
negotiated language into the ZPT rendering process. Is there such a way?<br>
<br>
Suggestions welcomed!<br>
<br>
Chris</blockquote></div><br>
</div></div></blockquote></div><br>