What I do, not sure if it's 100% correct but it works:

In my mako template: <a
href="${request.route_url('home')}?language=en">${_(u"english")}</a>

In the view:
if 'language' in request.GET.keys():
            request.response.set_cookie('_LOCALE_', request.GET['language'])
            return request.response

So when the language is selected, the home screen is opened in the right
language and from that point everything is in the right language.


On Tue, Apr 16, 2013 at 12:13 PM, Krishnakant Mane <[email protected]> wrote:

> Hello I am in the process of doing i18n and l10n for my web application.
> I use mako template and all the words to be translated have been put into
> a ${_()} along with generation of pot file.
> I also generated a po file for my language, Marathi.
>
>
> Now, I know I have to add a dropdown list labled "please choose a language
> " but I exactly wish to know how to program the interface or the
> application for setting the chosen language for the session?
> For example I might select Marathi and click set.
> Now from this point, my marathi interface should come.
> I am not getting exactly what to configure and how to configure this.
> Can some one guide in this regard.
> Happy Hacking.
> Krishnakant.
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> pylons-discuss+unsubscribe@**googlegroups.com<pylons-discuss%[email protected]>
> .
> To post to this group, send email to 
> pylons-discuss@googlegroups.**com<[email protected]>
> .
> Visit this group at 
> http://groups.google.com/**group/pylons-discuss?hl=en<http://groups.google.com/group/pylons-discuss?hl=en>
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
> .
>
>
>

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


Reply via email to