On Wed, Jun 11, 2008 at 5:40 AM, kai <[EMAIL PROTECTED]> wrote:
> Hi All,
> How do I modify the mako template path per request. I'm serving up
> multiple languages and and I have the i18n stuff working. However some
> of the markup needs to also vary depending on the language.
> so during the request cycle I want to change the path to something like
> path = ['/myapp/templates/fr','/myapp/templates/default']
>
> in order to pickup a language customized template if it is there and
> take the default if it is not.

Can you do something like:

    render_mako(lang + 'template')

When I do I18N, I try really hard not to create templates for each
language.  Even in cases where I have to change the order of the
fields, I try to do so with Python:

% for field in _('PREFERRED FIELD ORDER')
%     if field == 'first_name':
%         ...

The thought of having 8 copies of the same HTML terrifies me ;)

-jj

-- 
I, for one, welcome our new Facebook overlords!
http://jjinux.blogspot.com/

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