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

Language fallback based on the user's preferences #7996

Closed
quincylvania opened this issue Sep 15, 2020 · 1 comment
Closed

Language fallback based on the user's preferences #7996

quincylvania opened this issue Sep 15, 2020 · 1 comment
Assignees
Labels
localization Adapting iD across languages, regions, and cultures
Milestone

Comments

@quincylvania
Copy link
Collaborator

If a string is untranslated in the user's preferred locale, iD currently falls back only to English. However, modern browsers let users specify multiple ordered language preferences. iD should attempt to fallback to one or more of these before English.

Re: #7713

@quincylvania quincylvania added the localization Adapting iD across languages, regions, and cultures label Sep 15, 2020
@quincylvania quincylvania added this to the 2.19.0 milestone Sep 15, 2020
@quincylvania quincylvania self-assigned this Sep 15, 2020
@quincylvania
Copy link
Collaborator Author

I did this! iD will now attempt to use all the user's specified languages before defaulting to English. In the below example, the set locale is Greek, but untranslated terms fallback to the user's next language, German. Since I did #7994, and German currently has 100% coverage, the English locale is never loaded at all 💪

In addition, iD will now fallback to generic locales from regional locales when possible, e.g. pt-BR to pt.

Screen Shot 2020-09-15 at 5 47 23 PM

quincylvania added a commit that referenced this issue Sep 23, 2020
Include all preferred and fallback langauges in coreLocalizer.localeCodes even if higher-priority ones have 100% string coverage
Fallback to the user's preferred languages instead of directly to English when querying OSM wikibase documentation and Wikidata (re: #7996)
Add `lang` attribute to tag documentation text loaded from OSM wikibase or Wikidata (re: #7963)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
localization Adapting iD across languages, regions, and cultures
Projects
None yet
Development

No branches or pull requests

1 participant