title: Django: i18n - change language
body: <p>I'm install model_translation, rosetta, locale_url. But does not work change language.</p>
  
  <p>My settings.py:</p>
  
  <pre><code>LANGUAGE_CODE = 'ru'
  MODELTRANSLATION_TRANSLATION_REGISTRY = "project.translation"
  TRANSLATION_REGISTRY = "project.translation"
  ugettext = lambda s: s
  LANGUAGES = (
      ('ru', ugettext(u'Russian')),
      ('uk', ugettext(u'Ukrainian')),
  )
  </code></pre>
  
  <p>My view for a language switch:</p>
  
  <pre><code>def set_language(request):
      next = request.REQUEST.get('next', None)
      if not next:
          next = request.META.get('HTTP_REFERER', None)
      if not next:
          next = '/'
      response = http.HttpResponseRedirect(next)
      if request.method == 'GET':
          lang_code = request.GET.get('language', None)
          if lang_code and check_for_language(lang_code):
              if hasattr(request, 'session'):
                  request.session['django_language'] = lang_code
              else:
                  response.set_cookie(settings.LANGUAGE_COOKIE_NAME, lang_code)
      return response
  </code></pre>
  
  <p>In templates:</p>
  
  <pre><code>&lt;a href="{% url set_lang %}?lang=uk&amp;next={{request.path}}"&gt;Ukranian&lt;/a&gt;
  </code></pre>
  
  <p>My middleware:</p>
  
  <pre><code>MIDDLEWARE_CLASSES = (
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.middleware.locale.LocaleMiddleware',
      'localeurl.middleware.LocaleURLMiddleware',
      'django.middleware.common.CommonMiddleware',  
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.middleware.csrf.CsrfResponseMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
  )
  </code></pre>
  
  <p>But the language switching does not work. If I turn on the link <a href="http://localhost/uk/" rel="noreferrer">http://localhost/uk/</a> language switch, but when switching to another page - the language back to the default language.
  What should I do?</p>