Friday, November 4, 2011

Re: I18N and caching: page don't change language until I press F5 in browser

On Friday, November 4, 2011 5:31:46 PM UTC+2, Salvatore Iovene wrote:
        if hasattr(request, 'session'):
            request.session['django_language'] = lang
        else:
            response.set_cookie(settings.LANGUAGE_COOKIE_NAME, lang)

I have solved my problem by setting the cookie unconditionally (i.e. outside of that else-statement). I copied that code from django.views.i18n.set_language. I wonder if that's a bug. 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/dmAVToeRYvEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment