Changes between Initial Version and Version 1 of Ticket #21446, comment 4


Ignore:
Timestamp:
Nov 29, 2013, 10:06:25 AM (11 years ago)
Author:
Krzysztof Jurewicz

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21446, comment 4

    initial v1  
    1 The project I’m currently working on uses Django as an API backend and AngularJS application as a fronted client to this API. The UI localization is done using Mozilla’s [http://l20n.org/ L20n project] and language changing is done on-the-fly, without reloading the page. However there are some parts of the site which use Django templates (like password change form), so making an AJAX call to `set_language` is still necessary, but they are loaded using iframes, so there is no need to perform a redirect.
     1The project I’m currently working on uses Django as an API backend and AngularJS application as a frontend client to this API. The UI localization is done using Mozilla’s [http://l20n.org/ L20n project] and language changing is done on-the-fly, without reloading the page. However there are some parts of the site which use Django templates (like password change form), so making an AJAX call to `set_language` is still necessary, but they are loaded using iframes, so there is no need to perform a redirect.
    22
    33Not performing a redirect when it is not explicitly requested seems tempting, but it will be backwards incompatible with the current behaviour – I guess there may be a significant number of sites which rely on the fact that `set_language` redirects them to the previous page (captured from the referer header). Maybe we should check `request.is_ajax()` and if it is true, omit the redirect unless `next` parameter is set? For old-style HTML websites it may be still a coarsely correct assumption that a redirect needs to be performed after changing the language. That way we can resign from introducing the new `no_redirect` parameter.
Back to Top