Re: change i18n language through hyperlinks

2008-12-03 Thread Ozgur Odabasi
wow this is dangerous! Changes language settings for all users ;P But I couldnt unerstand how session and cookie frameworks works, documented examples doesn't work... On Dec 3, 6:56 am, Ozgur Odabasi <[EMAIL PROTECTED]> wrote: > try this > > def set_language(request, lang_code): >         next =

Re: change i18n language through hyperlinks

2008-12-02 Thread Ozgur Odabasi
try this def set_language(request, lang_code): next = request.REQUEST.get('next', None) if not next: next = '/' response = http.HttpResponseRedirect(next) if lang_code and check_for_language(lang_code): settings.LANGUAGE_CODE=lang_co

Re: change i18n language through hyperlinks

2008-10-11 Thread Chuck22
thanks Satheesh, the set_language function is partially working for me. When I click the lauguage hyperlinks, only the word "Home" works, but when I change the msgid to be "Home1", it stop working. It seems that "Home" is a django preserved word which get auto-translated. 1. In my base.html, I ha

Re: change i18n language through hyperlinks

2008-10-09 Thread cschand
Even then you want in get method you can use the below code. In view from django import http from django.utils.translation import check_for_language from django.conf import settings def set_language(request, lang_code): """ Patched for Get method """ next = request.REQUEST.get(

Re: change i18n language through hyperlinks

2008-10-09 Thread Malcolm Tredinnick
On Thu, 2008-10-09 at 23:51 -0400, Chuck Bai2 wrote: > I want to allow user select language preference through clicking the > language hyperlinks like "_English_ | _French_" switch. And I also want > to redirect back to the previous page after clicking the language > switch. Is it possible to

change i18n language through hyperlinks

2008-10-09 Thread Chuck Bai2
I want to allow user select language preference through clicking the language hyperlinks like "_English_ | _French_" switch. And I also want to redirect back to the previous page after clicking the language switch. Is it possible to use Django view: django.views.i18n.set_language? In the docum