Add map preferred language to settings

This commit is contained in:
Victor Shcherb 2015-07-04 13:10:14 +03:00
parent 6a9d0ea27a
commit 8a96e32f74
3 changed files with 6 additions and 2 deletions

View file

@ -6,6 +6,7 @@
<PreferenceCategory android:title="@string/localization_pref_title" android:key="localization">
<ListPreference android:key="preferred_locale" android:title="@string/preferred_locale" android:summary="@string/preferred_locale_descr"></ListPreference>
<ListPreference android:key="default_driving_region" android:title="@string/driving_region" android:summary="@string/driving_region_descr"></ListPreference>
<ListPreference android:key="map_preferred_locale" android:title="@string/map_preferred_locale" android:summary="@string/map_preferred_locale_descr"></ListPreference>
<ListPreference android:key="default_metric_system" android:title="@string/unit_of_length" android:summary="@string/unit_of_length_descr"></ListPreference>

View file

@ -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));
}

View file

@ -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),