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

The website doesn't respect browser language or region #1468

Open
itsnotsaved opened this issue Sep 27, 2022 · 3 comments
Open

The website doesn't respect browser language or region #1468

itsnotsaved opened this issue Sep 27, 2022 · 3 comments

Comments

@itsnotsaved
Copy link

This is a multi-lingual site but (1) the website doesn't respect browser language https://en.wikipedia.org/wiki/IETF_language_tag (2) or you don't redirect user to appropriate site based on visitor's IP

@jprenken
Copy link
Contributor

Hi, @itsnotsaved,

Thanks for pointing this out. I did some research and this looks like a way that the site's architecture (Hugo + Netlify) could handle this: https://nanmu.me/en/posts/2020/hugo-i18n-automatic-language-redirection/

@tdelmas
Copy link
Collaborator

tdelmas commented Sep 28, 2022

It should be noted that when the visitor is on a page that have been translated in its language, the top of the page displays a link "View in [name of the language]".

Also, the solution linked in https://nanmu.me/en/posts/2020/hugo-i18n-automatic-language-redirection/ could have some drawbacks, like redirecting a user that wants to stay on the English homepage.

@itsnotsaved
Copy link
Author

itsnotsaved commented Sep 28, 2022

Also, the solution linked in https://nanmu.me/en/posts/2020/hugo-i18n-automatic-language-redirection/ could have some drawbacks, like redirecting a user that wants to stay on the English homepage.

It should be noted that when the visitor is on a page that have been translated in its language, the top of the page displays a link "View in [name of the language]".

I checked that. apparently, the 2nd feature already exist (however to view manually in docs page)

Suggestion:
You can set to load the appropriate locale site for the visitor directly. If someone wants to use english site, display it on the top (see screenshot) But if the site is loaded in english; i think you need to display "Language" word on that button (note: keep the drop-down list)
image

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

3 participants