Refactoring

here
ivanovlev 2017-01-15 22:46:30 +03:00
parent 2de9580dea
commit bfe24dd9f0
2 changed files with 3 additions and 9 deletions

View File

@ -10,7 +10,7 @@ public class LanguageUtils {
private static Map<Character, String> transliterateMap = new HashMap<Character, String>(){
{
//extended ASCII characters
put('æ', "ae"); put('œ', "oe"); put('ß', "B");
put('æ', "ae"); put('œ', "oe"); put('ß', "B"); put('ª', "a"); put('º', "o");
//russian chars
put('а', "a"); put('б', "b"); put('в', "v"); put('г', "g"); put('д', "d"); put('е', "e"); put('ё', "jo"); put('ж', "zh");
@ -67,13 +67,7 @@ public class LanguageUtils {
//convert diacritic
private static String flattenToAscii(String string) {
char[] out = new char[string.length()];
string = Normalizer.normalize(string, Normalizer.Form.NFD);
int j = 0;
for (int i = 0, n = string.length(); i < n; ++i) {
char c = string.charAt(i);
if (c <= '\u007F') out[j++] = c;
}
return new String(out);
return string.replaceAll("\\p{M}", "");
}
}

View File

@ -2,7 +2,7 @@
<changelog>
<release version="0.17.0" versioncode="81">
<change>Add weather support through "Weather Notification" app</change>
<change>Various fixes for K9 mail when using the generic notification receiver</change>
<change>Various fixes for K9 mail when using the generic notification receiver</change>
<change>Added transliteration option for notifications in the settings screen</change>
<change>Add a preference to hide the notification icon of Gadgetbridge</change>