On Mar 8, 2009, at 5:01 PM, uwe wrote:

After experimenting I found I could override the _() call in the mako
template with

<%
  from testapp.lib.i18n import _
%>

however this is somewhat labor intensive and I'd like to find a way to
override this in one place for all templates.

Any suggestion would be appreciated.

I setup the users locale in my BaseControllers __call__ method so its setup rather early and before any methods are called. Not sure why you'd need to override the _() that Pylons puts into Mako's namespace if you're setting up the i18n with the pylons.i18n.set_lang function though.

I believe the Pylons Book shows a system of setting it up too, though I haven't read that bit yet.

Cheers,
Ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to