v0.3.4a: fixed an issue where turkish devices were seeing string errors
this was due to the turkish non-dotted i being inserted when strings were being converted to lowercase, specifying the locale should fix this.
This commit is contained in:
parent
2c82a94ffc
commit
82b30e1228
|
@ -47,6 +47,7 @@ import java.io.OutputStream;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Locale;
|
||||
|
||||
public enum Rankings {
|
||||
|
||||
|
@ -231,7 +232,7 @@ public enum Rankings {
|
|||
|
||||
//conversion logic for pre-0.3.4 saves
|
||||
if (bundle.contains( REASON )){
|
||||
String info = bundle.getString( REASON ).toLowerCase();
|
||||
String info = bundle.getString( REASON ).toLowerCase(Locale.ENGLISH);
|
||||
if (info.equals("obtained the amulet of yendor")) cause = Amulet.class;
|
||||
else if (info.contains("goo")) cause = Goo.class;
|
||||
else if (info.contains("tengu")) cause = Tengu.class;
|
||||
|
|
|
@ -119,7 +119,7 @@ public class Messages {
|
|||
} else
|
||||
key = k;
|
||||
|
||||
if (!strings.containsKey(key.toLowerCase())){
|
||||
if (strings.containsKey(key.toLowerCase(Locale.ENGLISH))){
|
||||
//this is so child classes can inherit properties from their parents.
|
||||
//in cases where text is commonly grabbed as a utility from classes that aren't mean to be instantiated
|
||||
//(e.g. flavourbuff.dispTurns()) using .class directly is probably smarter to prevent unnecessary recursive calls.
|
||||
|
@ -129,8 +129,8 @@ public class Messages {
|
|||
return "!!!NO TEXT FOUND!!!";
|
||||
}
|
||||
} else {
|
||||
if (args.length > 0) return format(strings.get(key.toLowerCase()), args);
|
||||
else return strings.get(key.toLowerCase());
|
||||
if (args.length > 0) return format(strings.get(key.toLowerCase(Locale.ENGLISH)), args);
|
||||
else return strings.get(key.toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ public class Messages {
|
|||
String result = "";
|
||||
//split by any unicode space character
|
||||
for (String word : str.split("(?<=\\p{Zs})")){
|
||||
if (noCaps.contains(word.trim().toLowerCase().replaceAll(":|[0-9]", ""))){
|
||||
if (noCaps.contains(word.trim().toLowerCase(Locale.ENGLISH).replaceAll(":|[0-9]", ""))){
|
||||
result += word;
|
||||
} else {
|
||||
result += capitalize(word);
|
||||
|
|
Loading…
Reference in New Issue
Block a user