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

Unexpected behavior of automatic locale selection #656

Open
ezwelty opened this issue Dec 30, 2024 · 2 comments · May be fixed by #660
Open

Unexpected behavior of automatic locale selection #656

ezwelty opened this issue Dec 30, 2024 · 2 comments · May be fixed by #660
Labels
bug Unexpected problems or unintended behavior

Comments

@ezwelty
Copy link
Collaborator

ezwelty commented Dec 30, 2024

Reported via email by a user:

This beta website is in French. I am not French and am not currently in France. I was in France like 2 months ago, and some other websites were in French at that time, but they have long since changed back to English. So I'm forced to conclude that there might be an issue with your website. I am using Chrome -- when I switch to Firefox, it's in English.

This may be hard to address or improve on, but sharing here in case we can do something about it. I suspect that since it worked differently in the two browsers, that maybe the user visited the beta website once in Chrome while in France and the automatic language choice stuck via local storage?

@ezwelty ezwelty added the bug Unexpected problems or unintended behavior label Dec 30, 2024
@wbazant
Copy link
Collaborator

wbazant commented Dec 30, 2024

I saw it as well after inviting someone to test the app a week ago - their mobile picked the French locale for no discernible reason. They got on well enough, were stuck on an 'Elderberry' they wanted to add being missing, and I went to 'Settings' and changed it for them.

What it made me think, the language setting should be visible from the first interaction, in case it's wrong: on mobile it's one more reason to get a welcome screen (I've made #657 to track), and on desktop I think we should have the language setting in the top bar as on the live site.

the automatic language choice stuck via local storage

I also wonder if we should only be preserving the language choice when logged in "Remember me" mode?

@wbazant
Copy link
Collaborator

wbazant commented Jan 8, 2025

Looked into this a bit:

if we should only be preserving the language choice when logged in "Remember me" mode?

wasn't a good idea - using sessionStorage is useless for language selection, because opening something in a new tab doesn't preserve the setting.

New proposed resolution is to only save the language when a user selects one through a dropdown, or upon logging in in 'remember me' mode, and to clear the setting on log out.

Something for the ideas basket: I've read it's possible to do a server side setting by IP - the server reads an IP, puts a tag into the HTML that the i18n language detector uses, and it's super-customised. Not sure how much I like it, following the browser setting seems more respectful of the user's intent!

@wbazant wbazant linked a pull request Jan 8, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problems or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants