From ddecab7d254b8f77cae9d6d00c21a1abeb001778 Mon Sep 17 00:00:00 2001 From: "M. Hadi" Date: Sat, 1 Sep 2018 23:42:15 +0200 Subject: [PATCH] Changes Persian transliteration such that it does not alter Arabic. Test should run fine now. Also added punctuations. --- .../freeyourgadget/gadgetbridge/util/LanguageUtils.java | 8 ++------ .../gadgetbridge/test/LanguageUtilsTest.java | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/LanguageUtils.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/LanguageUtils.java index 158d5fcf9..fb0f952bd 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/LanguageUtils.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/util/LanguageUtils.java @@ -77,12 +77,8 @@ public class LanguageUtils { put('آ', "2"); put('ئ', "2"); put('إ', "2"); put('ؤ', "2"); put('أ', "2"); put('ء', "2"); // Persian(Farsi) - put('ا', "a"); put('ب', "b"); put('پ', "p"); put('ت', "t"); put('ث', "th"); put('ج', "j"); put('چ', "ch"); - put('ح', "h"); put('خ', "kh"); put('د', "d"); put('ذ', "z"); put('ر', "r"); put('ز', "z"); put('ژ', "zh"); - put('س', "s"); put('ش', "sh"); put('ص', "s"); put('ض', "z"); put('ط', "t"); put('ظ', "z'"); put('ع', "e"); - put('غ', "gh"); put('ف', "f"); put('ق', "q"); put('ک', "k"); put('گ', "g"); put('ل', "l"); put('م', "m"); - put('ن', "n"); put('و', "v"); put('ه', "h"); put('ي', "y"); put('ی', "y"); put('آ', "A"); put('ئ', "e"); - put('ء', "e"); put('ؤ', "w"); put('؟', "?"); + put('پ', "p"); put('چ', "ch"); put('ژ', "zh"); put('ک', "k"); put('گ', "g"); put('ی', "y"); + put('؟', "?"); put('٪', "%"); put('؛', ";"); put('،', ","); // Polish put('Ł', "L"); put('ł', "l"); diff --git a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/LanguageUtilsTest.java b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/LanguageUtilsTest.java index eb5aa1753..8c06c8764 100644 --- a/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/LanguageUtilsTest.java +++ b/app/src/test/java/nodomain/freeyourgadget/gadgetbridge/test/LanguageUtilsTest.java @@ -51,8 +51,8 @@ public class LanguageUtilsTest extends TestBase { String hamzaActual = LanguageUtils.transliterate(hamza); assertEquals("hamza transliteration failed", hamzaExpected, hamzaActual); - String farsi = "پچڜڤڥڨگݣ"; - String farsiExpected = "pchchvvggg"; + String farsi = "گچپژ"; + String farsiExpected = "gchpzh"; String farsiActual = LanguageUtils.transliterate(farsi); assertEquals("Farsi transiteration failed", farsiExpected, farsiActual); }