Changes between Version 1 and Version 2 of Ticket #21446, comment 4
- Timestamp:
- Nov 29, 2013, 10:07:04 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #21446, comment 4
v1 v2 1 The 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 aresome 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.1 The 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 still 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. 2 2 3 3 Not 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.