Display city local name

This commit is contained in:
Victor Shcherb 2015-08-01 21:10:37 +02:00
parent d822c78884
commit 70bf6b6aa6

View file

@ -156,7 +156,7 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity<City>
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<City>
@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