mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-09-03 21:15:37 +02:00
Adding Lithuanian transliteration
This commit is contained in:
parent
3af7b1dd3a
commit
93dcb2be0d
@ -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
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user