mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 21:06:50 +01:00
Merge pull request #1206 from UncleInf/transliterate_lithuanian
Adding Lithuanian transliteration
This commit is contained in:
commit
c4411a9c48
@ -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
|
||||
}
|
||||
|
@ -66,6 +66,19 @@ public class LanguageUtilsTest extends TestBase {
|
||||
assertEquals("Transliteration failed", result, output);
|
||||
}
|
||||
|
||||
@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