This commit is contained in:
Victor Shcherb 2015-11-08 12:27:27 +01:00
parent a09b852f21
commit 861831980f

View file

@ -7,7 +7,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import net.osmand.IProgress;
import net.osmand.IndexConstants;
import net.osmand.PlatformUtil;
@ -266,10 +265,23 @@ public class AppInitializer implements IProgress {
}
app.poiTypes.setPoiTranslator(new MapPoiTypes.PoiTranslator() {
public String getLangTranslation(String l) {
try {
Field f = R.string.class.getField("lang_"+l);
if (f != null) {
Integer in = (Integer) f.get(null);
return app.getString(in);
}
} catch (Exception e) {
System.err.println(e.getMessage());
}
return l;
}
@Override
public String getTranslation(AbstractPoiType type) {
if(type.getBaseLangType() != null) {
return getTranslation(type.getBaseLangType()) + "(" + type.getLang() +")";
return getTranslation(type.getBaseLangType()) + "(" + getLangTranslation(type.getLang()) +")";
}
try {
Field f = R.string.class.getField("poi_" + type.getIconKeyName());