diff --git a/forge-gui-android/pom.xml b/forge-gui-android/pom.xml index 0c722640e6e..9652aab3a5b 100644 --- a/forge-gui-android/pom.xml +++ b/forge-gui-android/pom.xml @@ -2,15 +2,16 @@ 4.0.0 + C:\Users\Peter\AppData\Local\Android\Sdk yyyyMMdd-HHmm jar - -Xms1024m - -Xmx1536m + -Xms4g + -Xmx8g 1.6.27.001 - keystore - alias - storepass - keypass + C:\Users\Peter\forge.keystore + Forge + parodius + parodius user pass ftp.cardforge.org diff --git a/forge-gui-android/project.properties b/forge-gui-android/project.properties index 92b16250484..57c4c3772bf 100644 --- a/forge-gui-android/project.properties +++ b/forge-gui-android/project.properties @@ -8,4 +8,5 @@ # project structure. # Project target. -target=android-20 +project.type=0 +target=android-25 diff --git a/forge-gui/src/main/java/forge/card/CardTranslation.java b/forge-gui/src/main/java/forge/card/CardTranslation.java index 76d6d8bb0a1..2a3edcc91c4 100644 --- a/forge-gui/src/main/java/forge/card/CardTranslation.java +++ b/forge-gui/src/main/java/forge/card/CardTranslation.java @@ -7,6 +7,7 @@ import forge.util.LineReader; import java.io.FileInputStream; import java.io.IOException; +import java.text.Normalizer; import java.util.HashMap; import java.util.Map; @@ -17,17 +18,9 @@ public class CardTranslation { public static Map translatedoracles; public static Map translatedflavors; - private static String sanitize(String text) { - text = text.replace("á", "a"); - text = text.replace("é", "e"); - text = text.replace("í", "i"); - text = text.replace("ó", "o"); - text = text.replace("ú", "u"); - text = text.replace("Á", "A"); - text = text.replace("É", "E"); - text = text.replace("Í", "I"); - text = text.replace("Ó", "O"); - text = text.replace("Ú", "U"); + private static String removeDiacritics(String text) { + text = Normalizer.normalize(text, Normalizer.Form.NFD); + text = text.replaceAll("[\\p{InCombiningDiacriticalMarks}]", ""); text = text.replace("ñ", "ny"); return text; } @@ -35,25 +28,25 @@ public class CardTranslation { private static void readTranslationFile(String language) { String filename = "cardnames-" + language + ".txt"; - try (LineReader translationFile = new LineReader(new FileInputStream(ForgeConstants.LANG_DIR + filename));) { + try (LineReader translationFile = new LineReader(new FileInputStream(ForgeConstants.LANG_DIR + filename))) { for (String line : translationFile.readLines()) { String[] matches = line.split("#"); if(matches.length >= 2) { - translatednames.put(matches[0], sanitize(matches[1])); + translatednames.put(matches[0], removeDiacritics(matches[1])); } if(matches.length >= 3) { - translatedtypes.put(matches[0], sanitize(matches[2])); + translatedtypes.put(matches[0], removeDiacritics(matches[2])); } if(matches.length >= 4) { - translatedoracles.put(matches[0], sanitize(matches[3]).replace("\\n", "\n\n")); + translatedoracles.put(matches[0], removeDiacritics(matches[3]).replace("\\n", "\n\n")); } if(matches.length >= 5) { - translatedflavors.put(matches[0], sanitize(matches[4])); + translatedflavors.put(matches[0], removeDiacritics(matches[4])); } } } catch (IOException e) { @@ -67,10 +60,10 @@ public class CardTranslation { public static void preloadTranslation(String language) { if (needsTranslation()) { - translatednames = new HashMap(); - translatedtypes = new HashMap(); - translatedoracles = new HashMap(); - translatedflavors = new HashMap(); + translatednames = new HashMap<>(); + translatedtypes = new HashMap<>(); + translatedoracles = new HashMap<>(); + translatedflavors = new HashMap<>(); readTranslationFile(ForgePreferences.FPref.UI_LANGUAGE.toString()); } }