openstreetmap / openstreetmap-website

The Rails application that powers OpenStreetMap
https://www.openstreetmap.org/
GNU General Public License v2.0
2.2k stars 910 forks source link

Query falls back to name:en for the object's name if present #2369

Open Prince-Kassad opened 5 years ago

Prince-Kassad commented 5 years ago

How to reproduce:

Expected result: The query should fall back to name=.

What happens instead: The query will always display the name from name:en=, if that tag is present on the object queried.

This is a problem because certain editors (like Maps.me) love adding name:en to things, which automatically blocks the name= from appearing on the query, which is really irritiating in non-English countries where this behavior is not expected.

tomhughes commented 5 years ago

Oh hang on you mean the name displayed in the side bar when viewing an object? So this is not anything to do with search?

tomhughes commented 5 years ago

If you could give an example URL of a failing query then that would be very helpful, as well as making it much clearer exactly what you are referring to.

Prince-Kassad commented 5 years ago

This query: https://www.openstreetmap.org/query?lat=50.13299&lon=8.91703 will display the English name "Brothers Grimm Memorial" on any browser regardless of language, even a browser with language set to German will display the language from name:en rather than the German name that is tagged as name.

tomhughes commented 5 years ago

A better URL is https://www.openstreetmap.org/query?lat=50.13299&lon=8.91703&locale=de#map=18/50.13299/8.91699 which starts more zoomed in and forces the locale to show the problem.

It's a tricky problem - we walk the locale fallback list and if we see a match then we use it. The problem is that en is always at the end of that list so that we pick up english messages when there is nothing else. We can't just ignore it in this case though as we want it when falling back from en-GB for example...

verdulo commented 3 years ago

EO Preferataj lingvoj en agordoj de profilo agorditaj al "eo pl", lingvo de retfoliumilo (useragent) ankaŭ agordita al "eo,pl", la informpeto plue liveras la valoron de la ŝlosilo "name:en" anstataŭ de "name:pl" aŭ "name".

Kial "en" ĉiam estas kiel rezerva lingvo en la listo? Tio ĉi diskriminacias na-anglaj parolantoj! Se neniu lingvo kongruas simple liveru la valoron de "name".


PL Preferowane języki w ustawieniach profilu ustawione na "eo pl", język przeglądarki (useragent) także ustawiony na "eo,pl", lecz zapytanie w dalszym ciągu zwraca wartość klucza "name:en" zamiast "name:pl" lub "name".

Dlaczego "en" zawsze jest na liście jako rezerwowy język? To jest dyskryminacja niemówiących po angielsku! Jeżeli żaden język pasuje, po prostu zwróć wartość z "name".


EN Preferred languages in profile settings set to "eo pl", browser language (useragent) also set to "eo, pl", but the query still returns "name: en" instead of "name:pl" or "name".

Why is "en" always listed as the fallback language? This is discrimination against non-English speakers! If no language matches, just return the value from "name".

tomhughes commented 3 years ago

Because the primary purpose of the fallback language is for selecting UI strings where we need some sort of default and "en" is the default because that is the source language - using the hierarchy to match name tags is very much an edge case but because we always add en to the end of the list of languages in order to make UI strings work we wind up find name:en as well.

verdulo commented 3 years ago

EO La problemo estas, ke mi havas 2 lingvojn (eo pl) agorditajn, sed la informpeto uzas nur la unuan (eo).

Angla estas rezerva lingvo por fasado de la retejo, kompreneble; sed kial angla (name:en) estas elektita kiel rezerva lingvo por informpetoj pri objektoj sur la mapo?! Kial ne uzu la ŝlosilon "name"?


PL Problemem jest to, że mając ustawione 2 języki (eo pl), zapytanie używa tylko pierwszego z listy (eo).

Angielski jest rezerwowym językiem dla interfejsu strony, zrozumiałe; ale dlaczego angielski (name:en) jest wybrany jako rezerwowy języka dla zapytań o obiekty na mapie?! Dlaczego nie jest używany klucz "name"?


EN The problem is that with 2 languages set (eo pl), the query only uses the first in the list (eo).

English is the fallback language for the website interface, understandable; but why is English (name:en) selected as the fallback language for querying map features ?! Why is the "name" key not being used?

tomhughes commented 3 years ago

Because nobody has ever written code to use a custom fallback list for that one edge case.

Please, stop assuming that everything is a giant conspiracy. Sometimes it's just nobody thought of something when the decided to reuse an existing piece of data.