mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-04-22 10:37:16 -04:00
Fix locale names not shown correctly
This commit is contained in:
@@ -5,6 +5,19 @@ public class DisplayableLocale {
|
||||
public final Locale mLocale;
|
||||
public final CharSequence mName;
|
||||
|
||||
private static Locale processStringLocale(String locale) {
|
||||
if (locale.contains("-")) {
|
||||
String[] split = locale.split("-");
|
||||
return new Locale(split[0], split[1]);
|
||||
} else {
|
||||
return new Locale(locale);
|
||||
}
|
||||
}
|
||||
|
||||
public DisplayableLocale(String locale) {
|
||||
this(processStringLocale(locale));
|
||||
}
|
||||
|
||||
public DisplayableLocale(Locale locale) {
|
||||
this(locale, locale.getDisplayName(locale));
|
||||
}
|
||||
|
||||
@@ -217,8 +217,7 @@ public class PojavLoginActivity extends BaseActivity
|
||||
System.out.println(currFile.getAbsolutePath());
|
||||
if (currFile.getAbsolutePath().contains("/values-") || currFile.getName().startsWith("values-")) {
|
||||
// TODO use regex(?)
|
||||
Locale thisLocale = new Locale(currFile.getName().replace("values-", "").replace("-r", "-"));
|
||||
langAdapter.add(new DisplayableLocale(thisLocale));
|
||||
langAdapter.add(new DisplayableLocale(currFile.getName().replace("values-", "").replace("-r", "-")));
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
@@ -248,7 +247,7 @@ public class PojavLoginActivity extends BaseActivity
|
||||
|
||||
Locale locale;
|
||||
if (position == 0) {
|
||||
locale = Locale.getDefault();
|
||||
locale = LocaleUtils.DEFAULT_LOCALE;
|
||||
} else if (position == 1) {
|
||||
locale = Locale.ENGLISH;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user