osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.66k stars 1.02k forks source link

Multilingual Wikipedia link #4295

Closed hakuchi closed 7 years ago

hakuchi commented 7 years ago

The OSM-Wiki for the Wikipedia key say:

In almost all cases, a single wikipedia tag as described above is sufficient. Data users can access articles in other languages where available using Wikipedia's interlanguage links. If interlanguage links are missing, this should usually be fixed within Wikipedia.

If I will open the Wikipedia article from a POI, OsmAnd show only the site generated from the language code set in OSM. OsmAnd should use the app language for the language inside Wikipedia links.

Example:

The "Louvre" in France: http://www.openstreetmap.org/relation/3262297
Here the Wikipedia key is wikipedia=de:Louvre. So if the phone and map language is set to Spanish, OsmAnd open the German Wikipedia site in the browser. For the "Louvre" are 139 articles in different languages available on Wikipedia.

Here the link in OsmAnd(App and settings in Spanish): pic1

If I tap on the link, this is the result in my browser: pic2

vshcherb commented 7 years ago

Fixed in OSM Data wikipedia | fr:Palais du Louvre

hakuchi commented 7 years ago

for me this is not fixed now the key is wikipedia=fr:Palais du Louvre, but if I tap on the link with app and map language set to Spanish/German/Italian/etc. the browser from my phone always open the France site.

OsmAnd should open wikipedia links in Spanish if I use OsmAnd in Spanish, and if I use OsmAnd in German/Italian/etc. the link should open the language from the settings, not the language from the key in OSM data.

Tested with the latest offline map and latest nightly

pebogufi commented 7 years ago

For me it also NOT fixed, I have 2 examples to show the problem:

user language is de, object language is fr The object is on latest map France_hauts-de-france_europe.obj, date 01/10/2017, wikipedia file is France_hauts-de-france_europe.wiki.obj date 24/09/2017)

Version osmand 2.7.0#22756M

Example-1

The object ist "Blockhaus d'Éperlecques" http://www.openstreetmap.org/way/212458951 with this tags:

addr:city=Éperlecques addr:country=FR addr:postcode=62910 addr:street=Rue des Sarts building:height=28 building:material=concrete building=yes heritage:operator=mhs heritage=3 historic=yes mhs:inscription_date=1986-09-03 military=bunker name=Blockhaus d'Éperlecques ref:mhs=PA00108267 roof:material=concrete source:heritage=data.gouv.fr:Ministère de la Culture - 04/2015 source=cadastre-dgi-fr source : Direction Générale des Impôts - Cadastre. Mise à jour : 2010 wikidata=Q884743 wikipedia=en:Blockhaus d'Éperlecques

wikidata=Q884743 shows this links to Wikipedia(5 entries) de "Blockhaus von Éperlecques" -> Checked, language is ok en "Blockhaus d'Éperlecques" -> Checked, language is ok fr "Blockhaus d'Éperlecques" -> Checked, language is ok pcd "Bunker d'Ésparleke" -> can't evaluate language because I am not familliar with this language ru "?????? ???????" -> can't evaluate language because I am not familliar with this language

so, for at least de, en, fr language links are correct.

I tab near the object and choose "Nearby wikipedia articles" I get tho lines: Blockhaus d'Éperlecques Blockhaus d'Éperlecques both look identical.

Test with line 1 (-> ERROR) Screenshot1-1 screenshot1-1

Title is en or fr ("Blockhaus d'Éperlecques") Text is de ("Das Blockhaus von Éperlecques() ist eine deutsche...")

Screenshot1-2 screenshot1-2

Title is en or fr ("Blockhaus d'Éperlecques") Text is de ("Das Blockhaus von Éperlecques() ist eine deutsche...") Language marker is "DE", which does not match language of title.

Screenshot1-3 (clicked on "VOLLSTÄNDIGEN ARTIKEL LESEN (ONLINE)" / READ FULL ARTICLE (ONLINE) ) screenshot1-3

Firefox tries to find "Blockhaus d'Éperlecques" in de.m.wikipedia... which leads to a "Diese Seite existiert nicht" / "page not found". because "Blockhaus d'Éperlecques" is wrong (fr), the search term should be de: "Blockhaus von Éperlecques" (de).

Test with line 2 (is ok) Page-1 (no screenshots needed) Title is fr ("Blockhaus d'Éperlecques") Text is fr ("Le blockhaus d'Éperlecques() ...")

Page-2 (no screenshots needed) Title is fr ("Blockhaus d'Éperlecques") Text is fr ("Le blockhaus d'Éperlecques() ...") Language marker is "FR", which matches language of title.

Page-2 (no screenshots needed) Acticle is found in fr --> So line 2 is ok, languege matches.

Example-2

Citadelle de Lille http://www.openstreetmap.org/way/149182091

alt_name=Citadelle de Lille architect=Vauban (ingénieur) artwork_type=fortification Vauban barrier=city_wall description=La porte de la Citadelle : classement par arrêté du 9 mai 1914 - La chapelle : classement par arrêté du 11 janvier 1921 - La citadelle proprement dite avec ses bâtiments, ses bastions, ses fossés, ses demi-lunes et ses glacis ; l'ouvrage dit du Grand Car drone=no-fly heritage=2 landuse=military mhs:inscription_date=1914-05-09 name:en=Citadel of Lille name=Citadelle ref:mhs=PA00107573 source=cadastre-dgi-fr source : Direction Générale des Impôts - Cadastre ; mise à jour : 2008 start_date:fr=17e siècle tourism=artwork wikidata=Q206252 wikipedia=fr:Citadelle de Lille

wikidata shows: shows this links to Wikipedia de "Zitadelle von Lille" -> Checked, language is ok en "Citadel of Lille" -> Checked, language is ok fr "Citadelle de Lille" -> Checked, language is ok id "Benteng Lille" -> can't evaluate language because I am not familliar with this language nl "Citadel van Rijsel" -> can't evaluate language because I am not familliar with this language zh "????" -> can't evaluate language because I am not familliar with this language

Screenshot_Cit-1 shows 2 only lines screenshot_cit-1

first is asian (can't identify) second is en "Citadel of Lille"

I did not test the asian one. Test of en line.

Screenshot_Cit-2 screenshot_cit-2

Title is en ("Citadel of Lille") Text is de ("Die Kaserne Boufflers...")

Screenshot_Cit-3 screenshot_cit-3

Title is en ("Citadel of Lille") Text is de ("Die Kaserne Boufflers...") Preset language marker is "DE", which matches language of text but NOT language of title (which is used for further search).

Screenshot_Cit-4 (clicked on "VOLLSTÄNDIGEN ARTIKEL LESEN (ONLINE)" / READ FULL ARTICLE (ONLINE) ) screenshot_cit-4

Firefox tries to find "Citadel of Lille" in de.m.wikipedia... which leads to a "Diese Seite existiert nicht" / "page not found". because "Citadel of Lille" is wrong (en), the search term should be de: "Zitadelle von Lille" (de).

Instead of (clicking on "VOLLSTÄNDIGEN ARTIKEL LESEN (ONLINE)" / READ FULL ARTICLE (ONLINE) ) I change language marker.

Available language markers are: DE, EN, FR, NL If I change language by language marker, text and title change correctly for all 4 languages! Also a change back to DE will now bring up the correct title in de "Zitadelle von Lille".

Conclusion

1 - the available buttons (Screenshot_Cit-1 some asian and en "Citadel of Lille" should be:

2 - the assignment of languages in title and text is wrong see Screenshot1-1, Screenshot1-2, Screenshot_Cit-2, Screenshot_Cit-3 which leads to a "page not found" if I open "READ FULL ARTICLE (ONLINE)".

Hope, I could help Regards Peter

crimean commented 7 years ago

@pebogufi thanks for the research! Fixed by https://github.com/osmandapp/Osmand/commit/86b47876939d1868431c3f9aa5ef915723fb999c

pebogufi commented 7 years ago

Thanks, Conclusion -2 is fixed. (assignment same languages in title and text). osmand version 2.7.0#22810M (15/10/2017)

The other unfortunately - not. Screenshot1-2 "Blockhaus von Éperlecques" shows in language selection only DE and EN but not FR. In wikidata FR is present and ok. User language of object (in this case FR) is quite important:

So please be so kind to ensure, that user language of object is always present. Thanks a lot, Peter