1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-22 21:10:21 +02:00

Adding Lithuanian transliteration

This commit is contained in:
Thomas 2018-08-12 11:31:35 +03:00
parent 3af7b1dd3a
commit 93dcb2be0d
2 changed files with 16 additions and 0 deletions

View File

@ -78,6 +78,9 @@ public class LanguageUtils {
// Polish
put('Ł', "L"); put('ł', "l");
//Lithuanian
put('ą', "a"); put('č', "c"); put('ę', "e"); put('ė', "e"); put('į', "i"); put('š', "s"); put('ų', "u"); put('ū', "u"); put('ž', "z");
//TODO: these must be configurable. If someone wants to transliterate cyrillic it does not mean his device has no German umlauts
//all or nothing is really bad here
}

View File

@ -57,6 +57,19 @@ public class LanguageUtilsTest extends TestBase {
assertEquals("Farsi transiteration failed", farsiExpected, farsiActual);
}
@Test
public void testStringTransliterateLithuanian() {
String input = "ą č ę ė į š ų ū ž";
String output = LanguageUtils.transliterate(input);
String expected = "a c e e i s u u z";
assertEquals("lithuanian translation failed", expected, output);
input = "aąa cčc eęe eėe iįi sšs uųu uūu zžz";
output = LanguageUtils.transliterate(input);
expected = "aaa ccc eee eee iii sss uuu uuu zzz";
assertEquals("lithuanian translation failed", expected, output);
}
@Test
public void testTransliterateOption() throws Exception {
setDefaultTransliteration();