From c5b197beafdc1344c5f3cd16ee097298e05c41b2 Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Fri, 1 Apr 2016 12:40:11 +0300 Subject: [PATCH] Fix https://github.com/osmandapp/Osmand/issues/2393 --- OsmAnd/src/net/osmand/plus/views/POIMapLayer.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java index 5b01766d98..28e561711a 100644 --- a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java @@ -305,11 +305,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon public static void showWikipediaDialog(Context ctx, OsmandApplication app, Amenity a) { String lang = app.getSettings().MAP_PREFERRED_LOCALE.get(); if (a.getType().isWiki()) { - String preferredLang = lang; - if (Algorithms.isEmpty(preferredLang)) { - preferredLang = app.getLanguage(); - } - showWiki(ctx, app, a, preferredLang); + showWiki(ctx, app, a, lang); } } @@ -326,11 +322,15 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon } private static void showWiki(final Context ctx, final OsmandApplication app, final Amenity a, final String lang) { + String preferredLang = lang; + if (Algorithms.isEmpty(preferredLang)) { + preferredLang = app.getLanguage(); + } final Dialog dialog = new Dialog(ctx, app.getSettings().isLightContent() ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme); - final String title = a.getName(lang); + final String title = Algorithms.isEmpty(lang) ? a.getName() : a.getName(lang); LinearLayout ll = new LinearLayout(ctx); ll.setOrientation(LinearLayout.VERTICAL); @@ -342,7 +342,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon topBar.setBackgroundColor(ctx.getResources().getColor(getResIdFromAttribute(ctx, R.attr.pstsTabBackground))); topBar.setTitleTextColor(ctx.getResources().getColor(getResIdFromAttribute(ctx, R.attr.pstsTextColor))); - String lng = a.getContentSelected("content", lang, "en"); + String lng = a.getContentSelected("content", preferredLang, "en"); if (Algorithms.isEmpty(lng)) { lng = "en"; }