Skip to content

Advanced preferences, language dropdown in basic preferences #6024

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

Merged
merged 13 commits into from
Jun 1, 2025

Conversation

AntonKhorev
Copy link
Collaborator

@AntonKhorev AntonKhorev commented May 17, 2025

The goal was to get #5201 to a mergeable state, but its language dropdown is in suboptimal state. So I decided to take a second attempt at #4461 which also has a language selector. If the attempt is successful, the selector can be reused in #5201.

The problems in #5201 with the language selector were:

  • Forcing translators to translate every language name into every language;
  • Throwing away some languages because of case-sensitive matching;
  • Showing languages in the current locale which you may not be able to read. This should be a problem for a computer in India scenario from Language switcher on the homepage #1115, where they have not just different languages but different scripts too. Anyone selects a wrong script, and then nobody is able to read anything, language names included.

The list in this PR is generated using this idea #5201 (comment), by reading native language names from comments in yml files. If we're not sure whether these comments are going to stay (the files are updated by TranslateWiki), we can dump them to some other file and read from there (UPD: done). Note that the UI language set differs from the diary language set in config/languages.yml. The resulting language dropdown shows native language names in case/diactric-insensitive order.

image

image

image

Fixes #2581 by showing all available UI languages in a dropdown. You might still want to specify other languages for displaying name tags, that's what the language input on the Advanced Preferences page is for. I tried putting everyting on one page, but that complicates the user interface as you can see in #4461. A one-page solution would require either showing two language inputs at the same time or adding some button to switch between them, requiring javascript. The solution here doesn't require extra javascript.

Copy link

1 Warning
⚠️ Number of updated lines of code is too large to be in one PR. Perhaps it should be separated into two or more?

Generated by 🚫 Danger

@AntonKhorev AntonKhorev force-pushed the advanced-preferences branch 3 times, most recently from c54a9df to 64b41a8 Compare May 17, 2025 18:40
@AntonKhorev AntonKhorev force-pushed the advanced-preferences branch 2 times, most recently from ca2db20 to 4bfe88b Compare May 18, 2025 12:40
@AntonKhorev AntonKhorev requested a review from tomhughes May 18, 2025 12:51
@AntonKhorev AntonKhorev force-pushed the advanced-preferences branch from 4bfe88b to 2e7e70b Compare May 31, 2025 13:35
Copy link
Member

@tomhughes tomhughes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess a static file works as well at least for now, so I think this is good to merge, thaks.

@tomhughes tomhughes merged commit 2e274e0 into openstreetmap:master Jun 1, 2025
18 of 23 checks passed
@AntonKhorev AntonKhorev deleted the advanced-preferences branch June 1, 2025 15:41
@AntonKhorev AntonKhorev mentioned this pull request Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add language dropdown menu
2 participants