diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/CommonPreference.java b/OsmAnd/src/net/osmand/plus/settings/backend/CommonPreference.java index 28b71f4383..eed0121d99 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/CommonPreference.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/CommonPreference.java @@ -89,7 +89,6 @@ public abstract class CommonPreference extends PreferenceWithListener { defaultValues.put(mode, defValue); } - // TODO final @Override public boolean setModeValue(ApplicationMode mode, T obj) { if (global) { @@ -106,7 +105,6 @@ public abstract class CommonPreference extends PreferenceWithListener { return valueSaved; } - // TODO final public T getProfileDefaultValue(ApplicationMode mode) { if (global) { return defaultValue; @@ -129,7 +127,6 @@ public abstract class CommonPreference extends PreferenceWithListener { return defaultValues != null && defaultValues.containsKey(mode); } - // TODO final protected T getDefaultValue() { return getProfileDefaultValue(settings.APPLICATION_MODE.get()); } @@ -139,7 +136,6 @@ public abstract class CommonPreference extends PreferenceWithListener { this.defaultValue = newDefaultValue; } - // TODO final @Override public T getModeValue(ApplicationMode mode) { if (global) { @@ -149,14 +145,13 @@ public abstract class CommonPreference extends PreferenceWithListener { return getValue(settings.getProfilePreferences(mode), defaultV); } - // TODO final @Override public T get() { if (cache && cachedValue != null && cachedPreference == getPreferences()) { return cachedValue; } cachedPreference = getPreferences(); - cachedValue = getValue(cachedPreference, getProfileDefaultValue(settings.APPLICATION_MODE.get())); + cachedValue = getValue(cachedPreference, getDefaultValue()); return cachedValue; } @@ -181,7 +176,6 @@ public abstract class CommonPreference extends PreferenceWithListener { } } - // TODO final @Override public boolean set(T obj) { Object prefs = getPreferences(); @@ -210,7 +204,6 @@ public abstract class CommonPreference extends PreferenceWithListener { return shared; } - // TODO final @Override public boolean writeToJson(JSONObject json, ApplicationMode appMode) throws JSONException { if (appMode != null) { @@ -231,7 +224,6 @@ public abstract class CommonPreference extends PreferenceWithListener { return false; } - // TODO final @Override public void readFromJson(JSONObject json, ApplicationMode appMode) throws JSONException { if (appMode != null) { @@ -256,4 +248,4 @@ public abstract class CommonPreference extends PreferenceWithListener { T v = getModeValue(m); return toString(v); } -} \ No newline at end of file +} diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java index 01758f60b2..ec7d2b067f 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java @@ -11,6 +11,10 @@ import android.net.NetworkInfo; import android.os.Build; import android.os.Environment; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.util.Pair; + import net.osmand.FileUtils; import net.osmand.IndexConstants; import net.osmand.PlatformUtil; @@ -77,10 +81,6 @@ import java.util.Map; import java.util.Set; import java.util.StringTokenizer; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.core.util.Pair; - import static net.osmand.aidlapi.OsmAndCustomizationConstants.CONFIGURE_MAP_ITEM_ID_SCHEME; import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_ITEM_ID_SCHEME; import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_ACTIONS; @@ -1119,7 +1119,13 @@ public class OsmandSettings { public final OsmandPreference PREFERRED_LOCALE = new StringPreference(this, "preferred_locale", "").makeGlobal().makeShared(); public final OsmandPreference MAP_PREFERRED_LOCALE = new StringPreference(this, "map_preferred_locale", "").makeGlobal().makeShared().cache(); - public final OsmandPreference MAP_TRANSLITERATE_NAMES = new BooleanPreference(this, "map_transliterate_names", false).makeGlobal().makeShared().cache(); + public final OsmandPreference MAP_TRANSLITERATE_NAMES = new BooleanPreference(this, "map_transliterate_names", false) { + + protected Boolean getDefaultValue() { + return usingEnglishNames(); + } + + }.makeGlobal().makeShared().cache(); public boolean usingEnglishNames() { return MAP_PREFERRED_LOCALE.get().equals("en");