start sorting locales
This commit is contained in:
parent
20ec1a74f3
commit
b745f22943
2 changed files with 8 additions and 7 deletions
|
@ -262,6 +262,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR
|
||||||
getString(R.string.lang_uk),
|
getString(R.string.lang_uk),
|
||||||
getString(R.string.lang_vi) + incompleteSuffix,
|
getString(R.string.lang_vi) + incompleteSuffix,
|
||||||
getString(R.string.lang_cy) + incompleteSuffix,};
|
getString(R.string.lang_cy) + incompleteSuffix,};
|
||||||
|
String[] idslp = ConfigureMapMenu.getSortedMapNamesIds(this, entries, entrievalues);
|
||||||
registerListPreference(settings.PREFERRED_LOCALE, screen, entries, entrieValues);
|
registerListPreference(settings.PREFERRED_LOCALE, screen, entries, entrieValues);
|
||||||
|
|
||||||
// Display "Device language" in Latin for all non-en languages
|
// 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) + ")");
|
((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);
|
registerListPreference(settings.MAP_PREFERRED_LOCALE, screen, ConfigureMapMenu.getMapNamesValues(this, ids), ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -475,7 +475,7 @@ public class ConfigureMapMenu {
|
||||||
AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
|
AlertDialog.Builder b = new AlertDialog.Builder(view.getContext());
|
||||||
// test old descr as title
|
// test old descr as title
|
||||||
b.setTitle(R.string.map_preferred_locale);
|
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);
|
final String[] txtValues = getMapNamesValues(activity, txtIds);
|
||||||
int selected = -1;
|
int selected = -1;
|
||||||
for (int i = 0; i < txtIds.length; i++) {
|
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[] 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[] ids, String[] values) {
|
||||||
public static String[] getSortedMapNamesIds(Context ctx) {
|
//String[] vls = getMapNamesValues(ctx, mapNamesIds);
|
||||||
String[] vls = getMapNamesValues(ctx, mapNamesIds);
|
|
||||||
final Map<String, String> mp = new HashMap<>();
|
final Map<String, String> mp = new HashMap<>();
|
||||||
for (int i = 0; i < mapNamesIds.length; i++) {
|
for (int i = 0; i < ids.length; i++) {
|
||||||
mp.put(mapNamesIds[i], vls[i]);
|
mp.put(ids[i], values[i]);
|
||||||
}
|
}
|
||||||
ArrayList<String> lst = new ArrayList<>(mp.keySet());
|
ArrayList<String> lst = new ArrayList<>(mp.keySet());
|
||||||
Collections.sort(lst, new Comparator<String>() {
|
Collections.sort(lst, new Comparator<String>() {
|
||||||
|
|
Loading…
Reference in a new issue