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

i18n: autodetect browser language #33

Open
andreslucena opened this issue Sep 21, 2017 · 6 comments
Open

i18n: autodetect browser language #33

andreslucena opened this issue Sep 21, 2017 · 6 comments

Comments

@andreslucena
Copy link
Member

When I get to decidim.org I get the website on english. It should autodetect from my browser settings (catalan or spanish).

@zuzust
Copy link

zuzust commented Sep 21, 2017

As far as I know it can be achieved from the hosting provider side. No coding needed. Just saying.

@htmlboy
Copy link
Contributor

htmlboy commented Oct 5, 2017

This could be done either by an .htaccess configuration or a small javascript. In any case, we'll need to set a cookie when the user selects a language, to ensure user preferences prevail. Also, I'd limit this to the home page, for now.

Thoughts @andreslucena ?

@andreslucena
Copy link
Member Author

I have it working on #51 - the thing is that it doesn't allow to choose english on the homepage :(

@xabier xabier closed this as completed in f91eac7 Oct 7, 2017
xabier pushed a commit that referenced this issue Oct 7, 2017
Adding redirects on home for i18n autodetecting browser settings - closes #33
andreslucena added a commit that referenced this issue Oct 9, 2017
Revert "Adding redirects on home for i18n autodetecting browser settings - closes #33"
@andreslucena andreslucena reopened this Oct 16, 2017
@andreslucena
Copy link
Member Author

andreslucena commented Oct 16, 2017

There was an incompatiblity with this issue and #27 (regarding autodetecting browser language and changing lang on same page).

@passatgt
Copy link

So i did some research. When the user changes the language, you can create a cookie called nf_lang or nf_country with the language/country code, and this will take presedence over browser language/ip based redirects. So in this case, selecting English should create an nf_lang=en cookie and on every other language change, you can simply delete the cookie.

@xabier
Copy link
Contributor

xabier commented Nov 24, 2017

hi @passatgt thanks for your contribution! I hope @andreslucena or @zuzust or @htmlboy can build from that.

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

5 participants