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 =
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
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
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(
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
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
6 matches
Mail list logo