Fix lang
This commit is contained in:
parent
a09b852f21
commit
861831980f
1 changed files with 14 additions and 2 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue