From 8a96e32f74e7c68e03a666cd44cd573165197a17 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 4 Jul 2015 13:10:14 +0300 Subject: [PATCH] Add map preferred language to settings --- OsmAnd/res/xml/general_settings.xml | 1 + .../net/osmand/plus/activities/SettingsGeneralActivity.java | 3 +++ OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/xml/general_settings.xml b/OsmAnd/res/xml/general_settings.xml index 391d5fe777..fe4923c7a2 100644 --- a/OsmAnd/res/xml/general_settings.xml +++ b/OsmAnd/res/xml/general_settings.xml @@ -6,6 +6,7 @@ + diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java index fb36a5eb4b..2dc050febe 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java @@ -21,6 +21,7 @@ import net.osmand.plus.Version; import net.osmand.plus.dashboard.DashChooseAppDirFragment; import net.osmand.plus.dashboard.DashChooseAppDirFragment.ChooseAppDirFragment; import net.osmand.plus.dashboard.DashChooseAppDirFragment.MoveFilesToDifferentDirectory; +import net.osmand.plus.dialogs.ConfigureMapMenu; import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.download.DownloadActivityType; import net.osmand.plus.helpers.FileNameTranslationHelper; @@ -256,6 +257,8 @@ public class SettingsGeneralActivity extends SettingsBaseActivity { if (!getResources().getString(R.string.preferred_locale).equals(getResources().getString(R.string.preferred_locale_no_translate))) { ((ListPreference) screen.findPreference(settings.PREFERRED_LOCALE.getId())).setTitle(getString(R.string.preferred_locale) + " (" + getString(R.string.preferred_locale_no_translate) + ")"); } + + registerListPreference(settings.MAP_PREFERRED_LOCALE, screen, ConfigureMapMenu.mapNamesIds, ConfigureMapMenu.getMapNamesValues(this)); } diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index e2193cc131..e3be89b91d 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -397,10 +397,10 @@ public class ConfigureMapMenu { } } - static String[] mapNamesIds = new String[] { "", "en", "ar", "be", "bg", "ca", "ceb", "cs", "da", "de", "el", "et", "es", "fi", "fr", "gl", "he", "hi", + public static String[] mapNamesIds = new String[] { "", "en", "ar", "be", "bg", "ca", "ceb", "cs", "da", "de", "el", "et", "es", "fi", "fr", "gl", "he", "hi", "hr", "ht", "hu", "id", "it", "ja", "ko", "lt", "lv", "ms", "new", "nl", "nn", "no", "pl", "pt", "ro", "ru", "sk", "sl", "sr", "sv", "sw", "te", "th", "tr", "uk", "vi", "vo", "zh" }; - private String[] getMapNamesValues(Context ctx) { + public static String[] getMapNamesValues(Context ctx) { return new String[] { ctx.getString(R.string.local_map_names), ctx.getString(R.string.lang_en), ctx.getString(R.string.lang_ar), ctx.getString(R.string.lang_be), ctx.getString(R.string.lang_bg), ctx.getString(R.string.lang_ca), ctx.getString(R.string.lang_ceb), ctx.getString(R.string.lang_cs),