Ben Bangert wrote:
> 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
Thanks Ben.
I am setting up the users locale in the BaseController as well. The 
reason I want to override the language translation calls ( _(), 
get_lang, set_lang ) is to seed a database with the translatable strings 
contained within templates.

Uwe.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to