Issue #39 wontfix

Using LOCALEURL_USE_SESSION without change_locale view

77c_c33
created an issue

Right now LOCALEURL_USE_SESSION works only if change_locale view used, but why we can't just update/restore language in/from session in middleware? This way, we could use LOCALEURL_USE_SESSION without change_locale view too

Comments (2)

  1. Carl Meyer repo owner

    Hi! Thanks for the suggestion.

    The reason for the current behavior is that a language preference recorded in the user's session should be a language selected by the user's clear intent, not simply because they happened to be linked to a page in a certain language. In other words, a GET request should not change this important state of a user's session. So I don't believe that localeurl should always update the user's session in the middleware, but only via POST to the change_locale view.

    If you disagree, you can easily implement this yourself for your site by using a subclass of LocaleUrlMiddleware.

  2. Log in to comment