From 70bf6b6aa679fce34946ef251474d0c87d651021 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 1 Aug 2015 21:10:37 +0200 Subject: [PATCH] Display city local name --- .../plus/activities/search/SearchCityByNameActivity.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java index d2960491fe..0f0cc190aa 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java @@ -156,7 +156,7 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity public String getText(City obj) { LatLon l = obj.getLocation(); if (getCurrentFilter().length() > 2 ) { - String name = obj.getName(region.getLang()); + String name = getShortText(obj); if(obj.getClosestCity() != null) { name += " - " + obj.getClosestCity().getName(region.getLang()) ; LatLon loc = obj.getClosestCity().getLocation(); @@ -177,7 +177,12 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity @Override public String getShortText(City obj) { - return obj.getName(region.getLang()); + String lName = obj.getName(region.getLang()); + String name = obj.getName(); + if(!lName.equals(name)) { + return lName + " / " + name; + } + return lName; } @Override