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

Add a locale selector #3618

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

tomhughes
Copy link
Member

In light of https://www.openstreetmap.org/user/TrickyFoxy/diary/399621 I have resurrected my locale selector branch from many years ago that attempted to address #1115.

The rebased and updated version is running at https://locale.apis.dev.openstreetmap.org/ as it has been for the last N years...

Outstanding issues that we need to think about before we can consider merging this:

  • Where exactly to put the trigger control and how to present it - currently I have it showing the language code to save space while Wikimedia normally show the full language name.
  • What should take priority for logged in users? or maybe we just hide the control for logged in users?
  • Do we need a way to clear the override (other that restarting browser, which loses the session cookie) or not? Possibly if we ignore the cookie and hide the control for logged in users then we don't?

@deevroman
Copy link

There is another possible problem.
If you show this button on the main page, where there is a map, then the user can expect that the labels on the map will also change.

@tomhughes
Copy link
Member Author

Well they don't change for any of the existing ways of changing the locale so while that might be an issue it is not related to this PR and is off topic here.

@deevroman
Copy link

Issue like this make me think so #3547

@tomhughes
Copy link
Member Author

Yes we are perfectly well aware that's a requested feature, but not one that is something we as authors of this repository can do anything about as we do not provide the map tiles. Hence it is out of scope of this discussion.

@gravitystorm
Copy link
Collaborator

I'm not super keen on this, since browsers are in charge of dealing with language requests. There should (in theory, I know I know I know) be no need for language selectors. And so I find it surprising and a bit disappointing that in the linked diary post, the OP complains loudly about seeing a page in English when they have their browser set up to request pages in English. 🤷

However, if we choose to add one, then

  • It should only appear for logged out users. We already have a system for customising language preferences for logged in users.
  • I don't think there's a need for logged out users to be able to reset the override, they can just choose a different language
  • We should reconsider how the logged-in language preferences work, since we'll have a nicer UI for logged out users (a dropdown) than for logged in users (a somewhat cryptic text field).

I also think we should stopped filling in the language preferences automatically. I don't agree with the logic of grabbing the browser preferences supplied when they first create an account, and using that to override their browser prefs from that point on in perpetuity. If I switch my browser to request FR then I expect the site to respect that by default, unless I've specifically chosen differently. So I think:

  • We should leave the language preference blank by default, and only set it when the user does so explicitly
  • For logged in users, we should use: prefs (if set) -> browser (if set) -> en
  • For logged out users we should use: override (if set) -> browser (if set) -> en

@deevroman
Copy link

Yes we are perfectly well aware that's a requested feature, but not one that is something we as authors of this repository can do anything about as we do not provide the map tiles.

You understand, I understand. But the user, as in issue, will most likely expect something else.


How about using the differences of the user's country (for example, by GeoIP) and browser headers for the trigger of showing language switching?


when they have their browser set up to request pages in English. 🤷

From post: At first, for some reason, he is greeted by a page in English. Well, maybe the problem is in the browser. But why can’t I switch the language on the page?

the OP complains loudly

You say it like it was the whole post.

The lack of language switching was just a small thing that complicated the registration. There is quite a lot of text in the registration form and it is unpleasant to read it in a foreign language #2287 (comment) (But there is also a Help section and everything will be in a foreign language there too...)

And if you carefully re-read the post, you can understand that the situation arose in the built-in StreetComplete browser, which does not have any settings.


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

Successfully merging this pull request may close these issues.

3 participants