the Languages screen now loads more than 100x faster, thanks to optimizing Text.capitalize()
This commit is contained in:
parent
b609178976
commit
67d17e2914
2 changed files with 5 additions and 7 deletions
|
|
@ -240,8 +240,8 @@ public class NaturalLanguage extends Language implements Comparable<NaturalLangu
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(NaturalLanguage other) {
|
public int compareTo(NaturalLanguage other) {
|
||||||
String key = getName().equals("Suomi") ? "su" : getLocale().toString();
|
String key = getLocale().getCountry().equals("FI") ? "su" : getLocale().toString();
|
||||||
String otherKey = other.getName().equals("Suomi") ? "su" : other.getLocale().toString();
|
String otherKey = other.getLocale().getCountry().equals("FI") ? "su" : other.getLocale().toString();
|
||||||
return key.compareTo(otherKey);
|
return key.compareTo(otherKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,9 @@ public class Text extends TextTools {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text.length() == 1) {
|
char[] chars = text.toCharArray();
|
||||||
return text.toUpperCase(language.getLocale());
|
chars[0] = Character.toUpperCase(chars[0]);
|
||||||
} else {
|
return String.valueOf(chars);
|
||||||
return text.substring(0, 1).toUpperCase(language.getLocale()) + text.substring(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue