-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion - automatic language switching #37
Comments
Hi, I totally agree with this behavior. |
Hi, since django 1.10 now supports same language switching as solid-i18n. I like what you did, I'd suggest posting it as django issue or creating separate iddleware just for this functionality. |
@hovi @pierreben |
Hi guys, Actually, what I suggest doesn't serve a different content for the same URL, but it creates a 302 redirect to the language that best suits the user browser configuration. To solve this issue, what do you think about configuring |
Maybe I not understand the idea fully.
The suggestion is to stop redirecting from Example. The site is supporting two languages: English and Russian. English is default one.
Is this correct? |
Right, such case can happen, so |
Re using
SOLID_I18N_USE_REDIRECTS
andset_language
redirect view.Correct me if I am wrong, but
set_language
redirect view is used to switch language for cases when language is not part of url for example, because if so, changing to language-aware itself should be act of switching language. I see no reason using that view for unnecessary redirect since I have language-aware urls.Anyway I was playing around with it and changed middleware to logic that it doesn't try to use redirects if it already finds
LANGUAGE_SESSION_KEY
in session + it also sets this variable at end ofprocess_request
.Can make pull request, with complete example, but just checking if it makes sense.
Cheers, thanks for the code, been using it for months on production without
SOLID_I18N_USE_REDIRECTS
.The text was updated successfully, but these errors were encountered: