I used django 1.2 before and had no problems switching languages ... In my template, I have this ...
<form action="/i18n/setlang/" method="post" class="forms"> {% csrf_token %} <input name="next" type="hidden" value="/next/page/" /> <select name="language" id="select_langauge" class="m_show hide"> {% for lang in LANGUAGES %} {% if lang.0 != '' %} <option value="{{lang.0}}">{{lang.1}}</option> {% endif %} {% endfor %} </select>
This works fine with django 1.2. But since upgraded to Django 1.3, this will not work. I see that LANGUAGE_CODE is changing, but the actual language is not what I expected.
However, when I restart the django server, it shows the correct language. What am I missing ???
I have this in my settings.py
LANGUAGE_CODE = 'en-us' SITE_ID = 1 USE_I18N = True gettext = lambda s: s LANGUAGES = ( ('', gettext('Please select')), ('en', gettext('English')), ('ko', gettext('Korean')), ) USE_L10N = True MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.locale.LocaleMiddleware', )
source share