Skip to content
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

Where does it look the user preference language? #5

Closed
corand opened this issue Aug 28, 2014 · 5 comments
Closed

Where does it look the user preference language? #5

corand opened this issue Aug 28, 2014 · 5 comments

Comments

@corand
Copy link

corand commented Aug 28, 2014

By default in Django, when a user chooses another language, next time the same user accesses to the web, will be redirected to that language. For example:

In "foo.com", user changes the language to "en", so it is redirected to "foo.com/en/".

Next time this user goes to "foo.com", will be redirected to "foo.com/en/". This is the behaviour I was expecting from your "SOLID_I18N_USE_REDIRECTS = True". But this is not happening.

Where are you looking the user preference language? Maybe in the browser preference rather than in the cookies?

Anyway, thanks, good job!

@corand
Copy link
Author

corand commented Aug 28, 2014

Another example:
If I go to your site "http://www.lexev.org/", and I change the language to "en". Don't you think that next time I access to "http://www.lexev.org/" I should be redirected to "http://www.lexev.org/en/"?

Thanks again ;)

@st4lk
Copy link
Owner

st4lk commented Aug 31, 2014

Hello, Andoni !

  • 1st question (about "SOLID_I18N_USE_REDIRECTS = True").
    Can't reproduce the problem. Please precise, how do you implement the language switching. As it written in notes, you need to use set_language redirect view for language switching (form with method="POST"). Example site in this package also use this method: base.html. Have you tried the example site?
    So, this is what i do:
    • pip install solid-i18n (i have now Django==1.6.6 and solid-i18n==0.4.3 installed)
    • git clone git@github.com:st4lk/django-solid-i18n-urls.git
    • cd django-solid-i18n-urls/example
    • set SOLID_I18N_USE_REDIRECTS to True (it is set to False in repo) in example/settings.py.
    • python manage.py runserver
    • visit http://127.0.0.1:8000/
    • You see now english content. Click 'RU' button. You see now russian content, url starts with /ru/
    • visit http://127.0.0.1:8000/ again in new tab
    • you are redirected to /ru/
      Is this expected behaviour?
  • 2nd question (about lexev.org).
    Well, that's a good idea. Currently it is set SOLID_I18N_USE_REDIRECTS = False in settings.py of this site. I choose not to use redirects at all because of some search engines (mostly http://yandex.ru), that works not very will with redirects. But it's worth thinking, maybe i'll change it.

@corand
Copy link
Author

corand commented Sep 13, 2014

Finally decided to put the language prefix just on indivdiual post views (specially thinking on social shares). In the rest of the site I still follow with the Django default way.
Anyway, thanks for the answer, I'll keep it in mind!

@st4lk
Copy link
Owner

st4lk commented Sep 13, 2014

Ok. So, the problem is still exists or we can close this issue?

@corand
Copy link
Author

corand commented Sep 13, 2014

Close it. Thanks agian!

@st4lk st4lk closed this as completed Sep 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants