diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java index 8c161a65fc..e1b32fd2d5 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java @@ -262,6 +262,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR getString(R.string.lang_uk), getString(R.string.lang_vi) + incompleteSuffix, getString(R.string.lang_cy) + incompleteSuffix,}; + String[] idslp = ConfigureMapMenu.getSortedMapNamesIds(this, entries, entrievalues); registerListPreference(settings.PREFERRED_LOCALE, screen, entries, entrieValues); // Display "Device language" in Latin for all non-en languages @@ -269,7 +270,8 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR ((ListPreference) screen.findPreference(settings.PREFERRED_LOCALE.getId())).setTitle(getString(R.string.preferred_locale) + " (" + getString(R.string.preferred_locale_no_translate) + ")"); } - String[] ids = ConfigureMapMenu.getSortedMapNamesIds(this); + String[] values = ConfigureMapMenu.getMapNamesValues(this, ConfigureMapMenu.mapNamesIds); + String[] ids = ConfigureMapMenu.getSortedMapNamesIds(this, ConfigureMapMenu.mapNamesIds, values); registerListPreference(settings.MAP_PREFERRED_LOCALE, screen, ConfigureMapMenu.getMapNamesValues(this, ids), ids); } diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index ea9f6290a4..67020e0e33 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -475,7 +475,7 @@ public class ConfigureMapMenu { AlertDialog.Builder b = new AlertDialog.Builder(view.getContext()); // test old descr as title b.setTitle(R.string.map_preferred_locale); - final String[] txtIds = getSortedMapNamesIds(activity); + final String[] txtIds = getSortedMapNamesIds(activity, mapNameIds, getMapNamesValues(activity, mapNamesIds)); final String[] txtValues = getMapNamesValues(activity, txtIds); int selected = -1; for (int i = 0; i < txtIds.length; i++) { @@ -533,12 +533,11 @@ public class ConfigureMapMenu { public static String[] mapNamesIds = new String[]{"", "en", "als", "af", "ar", "az", "be", "bg", "bn", "bpy", "br", "bs", "ca", "ceb", "cs", "cy", "da", "de", "el", "eo", "et", "es", "eu", "fa", "fi", "fr", "fy", "ga", "gl", "he", "hi", "hr", "ht", "hu", "hy", "id", "is", "it", "ja", "ka", "ko", "ku", "la", "lb", "lt", "lv", "mk", "ml", "mr", "ms", "nds", "new", "nl", "nn", "no", "nv", "os", "pl", "pms", "pt", "ro", "ru", "sh", "sc", "sk", "sl", "sq", "sr", "sv", "sw", "ta", "te", "th", "tl", "tr", "uk", "vi", "vo", "zh"}; - - public static String[] getSortedMapNamesIds(Context ctx) { - String[] vls = getMapNamesValues(ctx, mapNamesIds); + public static String[] getSortedMapNamesIds(Context ctx, String[] ids, String[] values) { + //String[] vls = getMapNamesValues(ctx, mapNamesIds); final Map mp = new HashMap<>(); - for (int i = 0; i < mapNamesIds.length; i++) { - mp.put(mapNamesIds[i], vls[i]); + for (int i = 0; i < ids.length; i++) { + mp.put(ids[i], values[i]); } ArrayList lst = new ArrayList<>(mp.keySet()); Collections.sort(lst, new Comparator() {