Ukrainian/French layout
Add basic support for Ukrainian layout; Add missing chars to French layout; Remove unused chars in French layout; Rearrange French layout.
This commit is contained in:
parent
2673a3067b
commit
cd56dd182f
2 changed files with 249 additions and 224 deletions
|
|
@ -40,7 +40,7 @@ public class CharMap {
|
|||
enMap.put('9', 9); enMap.put('+', 0); enMap.put('0', 0);
|
||||
// add extra characters for German and French maps.
|
||||
enMap.put('€', 1); enMap.put('ß', 7); // German chars
|
||||
enMap.put('î', 4); enMap.put('ù', 8); // French chars
|
||||
enMap.put('æ', 1); enMap.put('î', 4); enMap.put('ù', 8); enMap.put('œ', 6); // French chars
|
||||
enMap.put('ì', 4); enMap.put('ò', 8); // Italian chars
|
||||
Map<Character, Integer> endefritmap = Collections.unmodifiableMap(enMap);
|
||||
CHARTABLE.add(0, endefritmap);
|
||||
|
|
@ -72,11 +72,18 @@ public class CharMap {
|
|||
ruMap.put('9', 9);
|
||||
ruMap.put('+', 0);
|
||||
ruMap.put('0', 0);
|
||||
|
||||
// add extra characters for other Cyrillic maps.
|
||||
ruMap.put('ґ', 2); ruMap.put('є', 3); ruMap.put('і', 4); ruMap.put('ї', 4);// Ukrainian chars
|
||||
// Stub for Bulgarian chars
|
||||
// Stub for Bielorussian chars
|
||||
// etc
|
||||
CHARTABLE.add(1, Collections.unmodifiableMap(ruMap));
|
||||
|
||||
CHARTABLE.add(2, Collections.unmodifiableMap(endefritmap));
|
||||
CHARTABLE.add(3, Collections.unmodifiableMap(endefritmap));
|
||||
CHARTABLE.add(4, Collections.unmodifiableMap(endefritmap));
|
||||
|
||||
}
|
||||
|
||||
protected static final char[][] ENT9TABLE = { { '0', '+' },
|
||||
|
|
@ -93,9 +100,10 @@ public class CharMap {
|
|||
{ 'р', 'с', 'т', 'у', 'Р', 'С', 'Т', 'У', '6' }, { 'ф', 'х', 'ц', 'ч', 'Ф', 'Х', 'Ц', 'Ч', '7' },
|
||||
{ 'ш', 'щ', 'ъ', 'ы', 'Ш', 'Щ', 'Ъ', 'Ы', '8' }, { 'ь', 'э', 'ю', 'я', 'Ь', 'Э', 'Ю', 'Я', '9' },
|
||||
{ ' ', '\n' }, { ' ', '0', '+' }, { '\n' } }; // LAST TWO SPACE ON 0
|
||||
|
||||
protected static final char[][] DET9TABLE = {
|
||||
{ '0', '+' },
|
||||
{ '.', ',', '?', '!', ':', ';', '"', '\'', '-', '@', '^', '€', '$', '%', '&', '*', '#', '(', ')', '_', '1' },
|
||||
{ ' ', '+', '0' },
|
||||
{ '.', ',', '?', '!', ':', ';', '"', '\'', '-', '@', '^', '€', '$', '%', '&', '*', '(', ')', '_', '1' },
|
||||
{ 'a', 'b', 'c', 'A', 'B', 'C', 'ä', 'Ä','á', 'â', 'à', 'å', 'ç', 'Á', 'Â', 'À', 'Å', 'Ç', '2' },
|
||||
{ 'd', 'e', 'f', 'D', 'E', 'F', 'é','ë','è','ê', 'É', 'Ë', 'È', 'Ê', '3' },
|
||||
{ 'g', 'h', 'i', 'G', 'H', 'I', 'í', 'ï', 'Í', 'Ï', '4' },
|
||||
|
|
@ -104,31 +112,39 @@ public class CharMap {
|
|||
{ 'p', 'q', 'r', 's', 'P', 'Q', 'R', 'S', 'ß', '7' },
|
||||
{ 't', 'u', 'v', 'T', 'U', 'V', 'ü', 'Ü', 'û', 'Û', '8' },
|
||||
{ 'w', 'x', 'y', 'z', 'W', 'X', 'Y', 'Z', '9' },
|
||||
{ ' ', '\n' }, { ' ', '0', '+' }, { '\n' } }; // LAST TWO SPACE ON 0
|
||||
{ '\n' } };
|
||||
|
||||
protected static final char[][] FRT9TABLE = {
|
||||
{ '0', '+' },
|
||||
{ '.', ',', '?', '!', ':', ';', '"', '/', '-', '@', '^', '€', '$', '%', '&', '*', '#', '(', ')', '_', '1' },
|
||||
{ 'a', 'b', 'c', 'A', 'B', 'C', 'ä', 'Ä','á', 'â', 'à', 'å', 'ç', 'Á', 'Â', 'À', 'Å', 'Ç', '2' },
|
||||
{ 'd', 'e', 'f', 'D', 'E', 'F', 'é','ë','è','ê', 'É', 'Ë', 'È', 'Ê', '3' },
|
||||
{ 'g', 'h', 'i', 'G', 'H', 'I', 'í', 'ï', 'Í', 'Ï', '4' },
|
||||
{ ' ', '+', '0' },
|
||||
{ '.', ',', '?', '!', ':', ';', '"', '/', '-', '@', '^', '€', '$', '%', '&', '*', '(', ')', '_', '1' },
|
||||
{ 'a', 'b', 'c', 'A', 'B', 'C', '2', 'â', 'à', 'æ', 'ç', 'Â', 'À', 'Æ', 'Ç'},
|
||||
{ 'd', 'e', 'f', 'D', 'E', 'F', '3', 'é', 'è','ê', 'ë', 'É', 'È', 'Ê', 'Ë' },
|
||||
{ 'g', 'h', 'i', 'G', 'H', 'I', '4', 'î', 'ï', 'Î', 'Ï' },
|
||||
{ 'j', 'k', 'l', 'J', 'K', 'L', '5' },
|
||||
{ 'm', 'n', 'o', 'M', 'N', 'O', 'ö', 'Ö', 'ñ','ó','ô', 'Ñ', 'Ó', 'Ô', '6' },
|
||||
{ 'p', 'q', 'r', 's', 'P', 'Q', 'R', 'S', 'ß', '7' },
|
||||
{ 't', 'u', 'v', 'T', 'U', 'V', 'ü', 'Ü', 'û', 'Û', '8' },
|
||||
{ 'm', 'n', 'o', 'M', 'N', 'O', '6', 'ô', 'œ', 'Ô', 'Œ'},
|
||||
{ 'p', 'q', 'r', 's', 'P', 'Q', 'R', 'S', '7' },
|
||||
{ 't', 'u', 'v', 'T', 'U', 'V', '8', 'û', 'Û', 'ù', 'Ù', 'ü', 'Ü'},
|
||||
{ 'w', 'x', 'y', 'z', 'W', 'X', 'Y', 'Z', '9' },
|
||||
{ ' ', '\n' }, { ' ', '0', '+' }, { '\n' } }; // LAST TWO SPACE ON 0
|
||||
{ '\n' } };
|
||||
|
||||
protected static final char[][] ITT9TABLE = {
|
||||
{ '+', '0' },
|
||||
{ '.', ',', '?', '!', ':', ';', '"', '/', '-', '@', '^', '€', '$', '%', '&', '*', '#', '(', ')', '_', '1' },
|
||||
{ ' ', '+', '0' },
|
||||
{ '.', ',', '?', '!', ':', ';', '"', '/', '-', '@', '^', '€', '$', '%', '&', '*', '(', ')', '_', '1' },
|
||||
{ 'a', 'b', 'c', 'A', 'B', 'C', 'à', 'À', '2' }, { 'd', 'e', 'f', 'D', 'E', 'F', 'é', 'è', 'É', 'È', '3' },
|
||||
{ 'g', 'h', 'i', 'G', 'H', 'I', 'ì', 'Ì', '4' }, { 'j', 'k', 'l', 'J', 'K', 'L', '5' },
|
||||
{ 'm', 'n', 'o', 'M', 'N', 'O', 'ò', 'Ò', '6' }, { 'p', 'q', 'r', 's', 'P', 'Q', 'R', 'S', '7' },
|
||||
{ 't', 'u', 'v', 'T', 'U', 'V', 'ù', 'Ù', '8' }, { 'w', 'x', 'y', 'z', 'W', 'X', 'Y', 'Z', '9' },
|
||||
{ '\n' } };
|
||||
|
||||
protected static final char[][] UKT9TABLE = { { '0', '+' },
|
||||
{ '.', ',', '?', '!', '\'', '"', '/', '-', '@', '$', '%', '&', '*', '#', '(', ')', '_', '1' },
|
||||
{ 'а', 'б', 'в', 'г', 'ґ', 'А', 'Б', 'В', 'Г', 'Ґ', '2' }, { 'д', 'е', 'є', 'ж', 'з', 'Д', 'Е', 'Є', 'Ж', 'З', '3' },
|
||||
{ 'и', 'і', 'ї', 'й', 'к', 'л', 'И', 'І', 'Ї', 'Й', 'К', 'Л', '4' }, { 'м', 'н', 'о', 'п', 'М', 'Н', 'О', 'П', '5' },
|
||||
{ 'р', 'с', 'т', 'у', 'Р', 'С', 'Т', 'У', '6' }, { 'ф', 'х', 'ц', 'ч', 'Ф', 'Х', 'Ц', 'Ч', '7' },
|
||||
{ 'ш', 'щ', 'Ш', 'Щ', '8' }, { 'ь', 'ю', 'я', 'Ь', 'Ю', 'Я', '9' },
|
||||
{ ' ', '\n' }, { ' ', '0', '+' }, { '\n' } }; // LAST TWO SPACE ON 0
|
||||
|
||||
protected static final char[][][] T9TABLE = { ENT9TABLE, RUT9TABLE, DET9TABLE, FRT9TABLE, ITT9TABLE };
|
||||
protected static final char[][][] T9TABLE = { ENT9TABLE, RUT9TABLE, DET9TABLE, FRT9TABLE, ITT9TABLE, UKT9TABLE };
|
||||
|
||||
// last 2 don't matter, are for spaceOnZero extra 'slots' 0 position, and 10 position
|
||||
protected static final int[] ENT9CAPSTART = { 0, 0, 3, 3, 3, 3, 3, 4, 3, 4, 0, 0, 0 };
|
||||
|
|
@ -136,7 +152,8 @@ public class CharMap {
|
|||
protected static final int[] DET9CAPSTART = { 0, 0, 3, 3, 3, 3, 3, 4, 3, 4, 0, 0, 0 };
|
||||
protected static final int[] FRT9CAPSTART = { 0, 0, 3, 3, 3, 3, 3, 4, 3, 4, 0, 0, 0 };
|
||||
protected static final int[] ITT9CAPSTART = { 0, 0, 3, 3, 3, 3, 3, 4, 3, 4, 0, 0, 0 };
|
||||
protected static final int[][] T9CAPSTART = {ENT9CAPSTART, RUT9CAPSTART, DET9CAPSTART, FRT9CAPSTART, ITT9CAPSTART};
|
||||
protected static final int[] UKT9CAPSTART = { 0, 0, 5, 5, 6, 4, 4, 4, 2, 3, 0, 0, 0 };
|
||||
protected static final int[][] T9CAPSTART = {ENT9CAPSTART, RUT9CAPSTART, DET9CAPSTART, FRT9CAPSTART, ITT9CAPSTART, UKT9CAPSTART};
|
||||
|
||||
protected static String getStringSequence(String word, LANGUAGE lang) {
|
||||
StringBuilder seq = new StringBuilder();
|
||||
|
|
@ -154,3 +171,4 @@ public class CharMap {
|
|||
return seq.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,13 +6,14 @@ import java.util.Map;
|
|||
|
||||
public class LangHelper {
|
||||
protected static final Locale RUSSIAN = new Locale("ru","RU");
|
||||
protected static final Locale UKRAINIAN = new Locale("uk","UA");
|
||||
public enum LANGUAGE {
|
||||
// MAKE SURE THESE MATCH WITH values/const.xml
|
||||
// (index, id) Where index is index in arrays like LOCALES and MUST increment and MUST be in
|
||||
// the same order as arrays.xml/pref_lang_values, and id is the identifier used in
|
||||
// the database and such. id should never change unless database update is done.
|
||||
// id MUST increment in doubles (as the enabled languages are stored as an integer)
|
||||
NONE(-1, -1), EN(0,1), RU(1,2), DE(2,4), FR(3,8), IT(4,16);
|
||||
NONE(-1, -1), EN(0,1), RU(1,2), DE(2,4), FR(3,8), IT(4,16), UK(5,32);
|
||||
public final int index;
|
||||
public final int id;
|
||||
// lookup map
|
||||
|
|
@ -25,7 +26,7 @@ public class LangHelper {
|
|||
public static LANGUAGE get(int i) { return lookup.get(i);}
|
||||
}
|
||||
|
||||
protected static final Locale[] LOCALES = {Locale.ENGLISH, RUSSIAN, Locale.GERMAN, Locale.FRENCH, Locale.ITALIAN};
|
||||
protected static final Locale[] LOCALES = {Locale.ENGLISH, RUSSIAN, Locale.GERMAN, Locale.FRENCH, Locale.ITALIAN, UKRAINIAN};
|
||||
|
||||
public static final int LANG_DEFAULT = LANGUAGE.EN.id;
|
||||
|
||||
|
|
@ -72,6 +73,12 @@ public class LangHelper {
|
|||
{R.drawable.ime_en_text_lower, R.drawable.ime_en_text_single, R.drawable.ime_en_text_upper}, //TEXT
|
||||
{R.drawable.ime_number}, //NUM
|
||||
},
|
||||
{
|
||||
// Ukrainian resources
|
||||
{R.drawable.ime_uk_lang_lower, R.drawable.ime_uk_lang_single, R.drawable.ime_uk_lang_upper}, //LANG
|
||||
{R.drawable.ime_ru_text_lower, R.drawable.ime_ru_text_single, R.drawable.ime_ru_text_upper}, //TEXT
|
||||
{R.drawable.ime_number}, //NUM
|
||||
},
|
||||
};
|
||||
|
||||
public static LANGUAGE[] buildLangs(int i) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue