Fix #11423 Wikipedia labels on the map shown on few languages
This commit is contained in:
parent
603f32df63
commit
e2d659e859
1 changed files with 15 additions and 15 deletions
|
@ -357,19 +357,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
|||
@Override
|
||||
public PointDescription getObjectName(Object o) {
|
||||
if (o instanceof Amenity) {
|
||||
Amenity amenity = (Amenity) o;
|
||||
String preferredLang = app.getSettings().MAP_PREFERRED_LOCALE.get();
|
||||
boolean transliterateNames = app.getSettings().MAP_TRANSLITERATE_NAMES.get();
|
||||
|
||||
if (amenity.getType().isWiki()) {
|
||||
if (Algorithms.isEmpty(preferredLang)) {
|
||||
preferredLang = app.getLanguage();
|
||||
}
|
||||
preferredLang = OsmandPlugin.onGetMapObjectsLocale(amenity, preferredLang);
|
||||
}
|
||||
|
||||
return new PointDescription(PointDescription.POINT_TYPE_POI,
|
||||
amenity.getName(preferredLang, transliterateNames));
|
||||
return new PointDescription(PointDescription.POINT_TYPE_POI, getAmenityName((Amenity) o));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -431,8 +419,20 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
|
|||
|
||||
@Override
|
||||
public String getText(Amenity o) {
|
||||
return o.getName(view.getSettings().MAP_PREFERRED_LOCALE.get(),
|
||||
view.getSettings().MAP_TRANSLITERATE_NAMES.get());
|
||||
return getAmenityName(o);
|
||||
}
|
||||
|
||||
private String getAmenityName(Amenity amenity) {
|
||||
String locale = app.getSettings().MAP_PREFERRED_LOCALE.get();
|
||||
|
||||
if (amenity.getType().isWiki()) {
|
||||
if (Algorithms.isEmpty(locale)) {
|
||||
locale = app.getLanguage();
|
||||
}
|
||||
locale = OsmandPlugin.onGetMapObjectsLocale(amenity, locale);
|
||||
}
|
||||
|
||||
return amenity.getName(locale, app.getSettings().MAP_TRANSLITERATE_NAMES.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue