1
0
Fork 0

Merge pull request #2 from iaros/patch-1

Add Ukrainian support; Edit French layout
This commit is contained in:
iaros 2017-03-28 06:27:58 +03:00 committed by GitHub
commit 70a06e812d
13 changed files with 549 additions and 332 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

97
res/values-uk/arrays.xml Normal file
View file

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="pref_inputmode_entries">
<item>Словник</item>
<item>Текст</item>
<item>Цифри</item>
</string-array>
<string-array name="pref_lang_titles">
<item>English</item>
<item>Російська</item>
<item>Німецька</item>
<item>Французька</item>
<item>Італійська</item>
<item>Українська</item>
</string-array>
<string-array name="capsMode">
<item>Нижній регістр</item>
<item>Починати з великої літери</item>
<item>Всі великі літери</item>
</string-array>
<string-array name="keyMode">
<item>Словник</item>
<item>Літери</item>
<item>Цифри</item>
</string-array>
<string-array name="smileyContentDescription">
<item>усмішка</item>
<item>клоун</item>
<item>дурненький</item>
<item>няшний</item>
<item>вусатий смайл</item>
<item>зловтіха</item>
<item>дуже щасливий</item>
<item>щасливий</item>
<item>вусань</item>
<item>сміється</item>
<item>сміється з розплющеними очима</item>
<item>сміється з заплющеними очима</item>
<item>в захваті</item>
<item>крутий</item>
<item>вчений</item>
<item>похмурий погляд</item>
<item>сумний</item>
<item>зневіра</item>
<item>сумний клоун</item>
<item>засмучений вусань</item>
<item>плаче</item>
<item>сміх до сліз</item>
<item>лається</item>
<item>страх</item>
<item>жах</item>
<item>кошмар</item>
<item>тривога</item>
<item>відкрив рота від обурення</item>
<item>шок</item>
<item>подив</item>
<item>поцілунок</item>
<item>посміхається підморгуючи</item>
<item>сміється підморгуючи</item>
<item>грайливий</item>
<item>показати язика</item>
<item>дражниться</item>
<item>киска с языком</item>
<item>раздратований</item>
<item>скептик</item>
<item>неопределился</item>
<item>не зрозумів</item>
<item>закрив очі</item>
<item>без відчуттів</item>
<item>рот зі скріпкою</item>
<item>німий як могила</item>
<item>в підтяжках</item>
<item>банкір</item>
<item>лежень</item>
<item>зубатий вампір</item>
<item>з\'їв кисле</item>
<item>святий</item>
<item>невинуватий</item>
<item>диявол підморгує</item>
<item>диявол</item>
<item>підозрілий</item>
<item>день народження</item>
<item>ура</item>
<item>серце</item>
<item>розбите серце</item>
<item>милий</item>
</string-array>
</resources>

69
res/values-uk/strings.xml Normal file
View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="action_settings">Налаштування</string>
<string name="add_word">Додати слово</string>
<string name="add_word_badchar">Неможливо додати слово з таким символом %1$s (%2$s).</string>
<string name="add_word_blank">Неможливо додати слово.</string>
<string name="add_word_exist1">Слово (%1$s) вже є в словнику.</string>
<string name="add_word_exist2">Слово (%1$s) вже є в словнику %2$s.</string>
<string name="app_name">Traditional T9</string>
<string name="hello_world">Hello world!</string>
<string name="ime_name">Клавіатура T9</string>
<string name="ime_number">Цифри</string>
<string name="main_left_addword">Додати слово</string>
<string name="main_left_insert">Вставити символ</string>
<string name="main_left_notfound">Додати слово?</string>
<string name="main_mid">Готово</string>
<string name="main_mid_commit">Застосувати</string>
<string name="main_right_lower">Змінити IME</string>
<string name="main_right_upper">Режим введення</string>
<string name="pref_backup_noext">Помилка: Зовнышня пам\'ять недоступна. Резервне копіювання неможливе.</string>
<string name="pref_backup_title">Резервне копіювання бази даних IME</string>
<string name="pref_backup_warn">Попередження: Існуюча копія бази даних буде перезаписана. Продовжити?</string>
<string name="pref_backupdict">Бекап словника</string>
<string name="pref_inputmode">Режим введення за замовчуванням</string>
<string name="pref_inputmode_desc">Режим введення за замовчуванням</string>
<string name="pref_load_title">Завантажити словник IME</string>
<string name="pref_loaddict">Завантажити словник</string>
<string name="pref_loadingbackup">Відновлення словника…</string>
<string name="pref_loadingdict">Завантаження словника</string>
<string name="pref_loadinguserdict">Завантаження словника користувача…</string>
<string name="pref_loaduserdict">Завантажити свій словник</string>
<string name="pref_lang_title">Багатомовна підтримка</string>
<string name="pref_nuke_title">Очистити IME словник</string>
<string name="pref_nuke_warn">Попередження: Буде виконана очистка словника. Продовжити?</string>
<string name="pref_nukedict">Очистка словника</string>
<string name="pref_nukingdict">Очистка словника… Будь-ласка, зачекайте…</string>
<string name="pref_querytest">Тестовий запит</string>
<string name="pref_restore_noext">Помилка: Зовнішня память недоступна. Відновлення неможливе.</string>
<string name="pref_restore_nofile">Помилка: Файл відновлення не знайдений.</string>
<string name="pref_restore_title">Відновити базу даних IME</string>
<string name="pref_restore_warn">При відновленні існуюча база даних буде витерта. Если это нежелательно, то сначала выберите \"%1$s\" перед использованием этой опции.</string>
<string name="pref_restoredict">Зберегти словник</string>
<string name="pref_savingbackup">Збереження словника…</string>
<string name="pref_testfunc">Test func</string>
<string name="ricon_desc">Hold Icon</string>
<string name="pref_help">Про програму</string>
<string name="symbol_next">Наступне</string>
<string name="symbol_prev">Попереднє</string>
<string name="symbol_insert">Вставити символ</string>
<string name="smiley_insert">Вставити смайл</string>
<string name="symbol_page">Стор: %1$s/%2$s</string>
<string name="close">Закрити</string>
<string name="database_notready">База даних недоступна.</string>
<string name="updating_database_title">Оновлення бази даних словника…</string>
<string name="updating_database">Виконується оновлення бази даних словника… \n Це займе деякий час.</string>
<string name="updating_database_done">Оновлення бази даних словника виконано успішно.</string>
<string name="updating_database_unavailable">Оновлення бізи даних словника недоступне.</string>
<string name="pref_loaduser_notfound"> Помилка. \n Словник %1$s не знайдено. </string>
<string name="pref_mode_notify_subtitle">Використовується для індикації зміни режима введення.</string>
<string name="pref_mode_notify">Режим індикації</string>
<string name="database_settings_notready">База даних недоступна. Використовуюься значення за замовчуванням.</string>
<string name="pref_reloadKeys">Перезавантажити значення клавіш</string>
<string name="title_activity_add_word">Додати слово</string>
<string name="traditionalt9_settings">Налаштування Traditional T9</string>
</resources>

View file

@ -1,109 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="pref_inputmode_entries">
<item>Dictionary</item>
<item>Text</item>
<item>Number</item>
</string-array>
<integer-array translatable="false" name="pref_inputmode_values">
<item>@integer/INPUT_DICT</item>
<item>@integer/INPUT_TEXT</item>
<item>@integer/INPUT_NUM</item>
</integer-array>
<string-array name="pref_inputmode_entries">
<item>Dictionary</item>
<item>Text</item>
<item>Number</item>
</string-array>
<integer-array translatable="false" name="pref_inputmode_values">
<item>@integer/INPUT_DICT</item>
<item>@integer/INPUT_TEXT</item>
<item>@integer/INPUT_NUM</item>
</integer-array>
<string-array name="pref_lang_titles">
<item>English</item>
<item>Russian</item>
<item>German</item>
<item>French</item>
<item>Italian</item>
</string-array>
<!--pref_lang_titles pair with pref_lang_values -->
<integer-array translatable="false" name="pref_lang_values">
<item>@integer/LANG_EN</item>
<item>@integer/LANG_RU</item>
<item>@integer/LANG_DE</item>
<item>@integer/LANG_FR</item>
<item>@integer/LANG_IT</item>
</integer-array>
<string-array name="pref_lang_titles">
<item>English</item>
<item>Russian</item>
<item>German</item>
<item>French</item>
<item>Italian</item>
<item>Ukrainian</item>
</string-array>
<!--pref_lang_titles pair with pref_lang_values -->
<integer-array translatable="false" name="pref_lang_values">
<item>@integer/LANG_EN</item>
<item>@integer/LANG_RU</item>
<item>@integer/LANG_DE</item>
<item>@integer/LANG_FR</item>
<item>@integer/LANG_IT</item>
<item>@integer/LANG_UK</item>
</integer-array>
<string-array name="capsMode">
<item>Caps off</item>
<item>Single capital</item>
<item>All caps</item>
</string-array>
<string-array name="capsMode">
<item>Caps off</item>
<item>Single capital</item>
<item>All caps</item>
</string-array>
<string-array name="keyMode">
<item>Dictionary</item>
<item>Text</item>
<item>Number</item>
</string-array>
<string-array name="keyMode">
<item>Dictionary</item>
<item>Text</item>
<item>Number</item>
</string-array>
<string-array name="smileyContentDescription">
<item> Smile </item>
<item> Clown </item>
<item> Sharp grin </item>
<item> Cat </item>
<item> Half nose </item>
<item> Schadenfreude </item>
<item> Big eye sharp grin </item>
<item> Big eye smile </item>
<item> Cheeky smile </item>
<item> Laughing </item>
<string-array name="smileyContentDescription">
<item> Smile </item>
<item> Clown </item>
<item> Sharp grin </item>
<item> Cat </item>
<item> Half nose </item>
<item> Schadenfreude </item>
<item> Big eye sharp grin </item>
<item> Big eye smile </item>
<item> Cheeky smile </item>
<item> Laughing </item>
<item> Bug eye laughing </item>
<item> Laughing with eyes closed </item>
<item> Big eye laughing </item>
<item> Glasses pointy nose laughing </item>
<item> Pointed hat smile </item>
<item> Frown </item>
<item> Sad </item>
<item> Disheartened </item>
<item> Sad clown </item>
<item> Sad cheeky </item>
<item> Bug eye laughing </item>
<item> Laughing with eyes closed </item>
<item> Big eye laughing </item>
<item> Glasses pointy nose laughing </item>
<item> Pointed hat smile </item>
<item> Frown </item>
<item> Sad </item>
<item> Disheartened </item>
<item> Sad clown </item>
<item> Sad cheeky </item>
<item> Crying </item>
<item> Laughing to tears </item>
<item> Expletive </item>
<item> Shocked frown </item>
<item> Bug eye\'d frown </item>
<item> Sad with eyes closed </item>
<item> Crying with mouth open </item>
<item> Frown with mouth open </item>
<item> Shocked </item>
<item> Surprised </item>
<item> Crying </item>
<item> Laughing to tears </item>
<item> Expletive </item>
<item> Shocked frown </item>
<item> Bug eye\'d frown </item>
<item> Sad with eyes closed </item>
<item> Crying with mouth open </item>
<item> Frown with mouth open </item>
<item> Shocked </item>
<item> Surprised </item>
<item> Kiss </item>
<item> Winking smile </item>
<item> Winking laugh </item>
<item> Cheeky tongue out </item>
<item> Tongue out </item>
<item> Teasing </item>
<item> Big eye\'d tongue out </item>
<item> Annoyed </item>
<item> Skeptic </item>
<item> Undecided </item>
<item> Kiss </item>
<item> Winking smile </item>
<item> Winking laugh </item>
<item> Cheeky tongue out </item>
<item> Tongue out </item>
<item> Teasing </item>
<item> Big eye\'d tongue out </item>
<item> Annoyed </item>
<item> Skeptic </item>
<item> Undecided </item>
<item> Confused </item>
<item> Closed eyes </item>
<item> Unimpressed </item>
<item> Bashful </item>
<item> Mouth shut </item>
<item> Censored </item>
<item> Banker </item>
<item> Very big sad mouth </item>
<item> Mischievous/sarcasm </item>
<item> Sour face </item>
<item> Confused </item>
<item> Closed eyes </item>
<item> Unimpressed </item>
<item> Bashful </item>
<item> Mouth shut </item>
<item> Censored </item>
<item> Banker </item>
<item> Very big sad mouth </item>
<item> Mischievous/sarcasm </item>
<item> Sour face </item>
<item> Innocent cat </item>
<item> Innocent smile </item>
<item> Evil wink </item>
<item> Evil grin </item>
<item> Shifty eyes </item>
<item> Party hat smile </item>
<item> Arms up cheering </item>
<item> Heart </item>
<item> Broken heart </item>
<item> big eye\'d cat </item>
</string-array>
<item> Innocent cat </item>
<item> Innocent smile </item>
<item> Evil wink </item>
<item> Evil grin </item>
<item> Shifty eyes </item>
<item> Party hat smile </item>
<item> Arms up cheering </item>
<item> Heart </item>
<item> Broken heart </item>
<item> big eye\'d cat </item>
</string-array>
</resources>

View file

@ -1,16 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- MAKE SURE THESE MATCH WITH LangHelper.java id -->
<integer name="LANG_EN">1</integer>
<integer name="LANG_RU">2</integer>
<integer name="LANG_DE">4</integer>
<integer name="LANG_FR">8</integer>
<integer name="LANG_IT">16</integer>
<!-- MAKE SURE THESE MATCH WITH LangHelper.java id -->
<integer name="LANG_EN">1</integer>
<integer name="LANG_RU">2</integer>
<integer name="LANG_DE">4</integer>
<integer name="LANG_FR">8</integer>
<integer name="LANG_IT">16</integer>
<integer name="LANG_UK">32</integer>
<integer name="INPUT_DICT">0</integer>
<integer name="INPUT_TEXT">1</integer>
<integer name="INPUT_NUM">2</integer>
<integer name="INPUT_DICT">0</integer>
<integer name="INPUT_TEXT">1</integer>
<integer name="INPUT_NUM">2</integer>
<integer name="INPUT_DEFAULT">@integer/INPUT_DICT</integer>
<integer name="LANG_DEFAULT">@integer/LANG_EN</integer>
<integer name="INPUT_DEFAULT">@integer/INPUT_DICT</integer>
<integer name="LANG_DEFAULT">@integer/LANG_EN</integer>
</resources>

View file

@ -11,146 +11,164 @@ import java.util.HashMap;
import java.util.Map;
public class CharMap {
protected static final AbstractList<Map<Character, Integer>> CHARTABLE = new ArrayList<Map<Character, Integer>>(LangHelper.NLANGS);
static {
// English
Map<Character, Integer> enMap = new HashMap<Character, Integer>();
enMap.put('.', 1); enMap.put(',', 1); enMap.put('!', 1); enMap.put('?', 1);
enMap.put('-', 1); enMap.put('"', 1); enMap.put('\'', 1); enMap.put('@', 1);
enMap.put('#', 1); enMap.put('$', 1); enMap.put('%', 1); enMap.put('&', 1);
enMap.put('*', 1); enMap.put('(', 1); enMap.put(')', 1); enMap.put(':', 1);
enMap.put(';', 1); enMap.put('/', 1); enMap.put('+', 1); enMap.put('=', 1);
enMap.put('<', 1); enMap.put('>', 1); enMap.put('^', 1); enMap.put('_', 1);
enMap.put('~', 1); enMap.put('1', 1);
enMap.put('a', 2); enMap.put('á', 2); enMap.put('ä', 2); enMap.put('â', 2);
enMap.put('à', 2); enMap.put('å', 2); enMap.put('b', 2); enMap.put('c', 2);
enMap.put('ç', 2); enMap.put('2', 2);
enMap.put('d', 3); enMap.put('e', 3); enMap.put('é', 3); enMap.put('ë', 3);
enMap.put('è', 3); enMap.put('ê', 3); enMap.put('f', 3); enMap.put('3', 3);
enMap.put('g', 4); enMap.put('h', 4); enMap.put('i', 4); enMap.put('í', 4);
enMap.put('ï', 4); enMap.put('4', 4);
enMap.put('j', 5); enMap.put('k', 5); enMap.put('l', 5); enMap.put('5', 5);
enMap.put('m', 6); enMap.put('n', 6); enMap.put('ñ', 6); enMap.put('o', 6);
enMap.put('ó', 6); enMap.put('ö', 6); enMap.put('ô', 6); enMap.put('6', 6);
enMap.put('p', 7); enMap.put('q', 7); enMap.put('r', 7); enMap.put('s', 7);
enMap.put('7', 7);
enMap.put('t', 8); enMap.put('u', 8); enMap.put('û', 6); enMap.put('ü', 8);
enMap.put('v', 8); enMap.put('8', 8); enMap.put('w', 9);
enMap.put('x', 9); enMap.put('y', 9); enMap.put('z', 9);
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('ì', 4); enMap.put('ò', 8); // Italian chars
Map<Character, Integer> endefritmap = Collections.unmodifiableMap(enMap);
CHARTABLE.add(0, endefritmap);
protected static final AbstractList<Map<Character, Integer>> CHARTABLE = new ArrayList<Map<Character, Integer>>(LangHelper.NLANGS);
static {
// English
Map<Character, Integer> enMap = new HashMap<Character, Integer>();
enMap.put('.', 1); enMap.put(',', 1); enMap.put('!', 1); enMap.put('?', 1);
enMap.put('-', 1); enMap.put('"', 1); enMap.put('\'', 1); enMap.put('@', 1);
enMap.put('#', 1); enMap.put('$', 1); enMap.put('%', 1); enMap.put('&', 1);
enMap.put('*', 1); enMap.put('(', 1); enMap.put(')', 1); enMap.put(':', 1);
enMap.put(';', 1); enMap.put('/', 1); enMap.put('+', 1); enMap.put('=', 1);
enMap.put('<', 1); enMap.put('>', 1); enMap.put('^', 1); enMap.put('_', 1);
enMap.put('~', 1); enMap.put('1', 1);
enMap.put('a', 2); enMap.put('á', 2); enMap.put('ä', 2); enMap.put('â', 2);
enMap.put('à', 2); enMap.put('å', 2); enMap.put('b', 2); enMap.put('c', 2);
enMap.put('ç', 2); enMap.put('2', 2);
enMap.put('d', 3); enMap.put('e', 3); enMap.put('é', 3); enMap.put('ë', 3);
enMap.put('è', 3); enMap.put('ê', 3); enMap.put('f', 3); enMap.put('3', 3);
enMap.put('g', 4); enMap.put('h', 4); enMap.put('i', 4); enMap.put('í', 4);
enMap.put('ï', 4); enMap.put('4', 4);
enMap.put('j', 5); enMap.put('k', 5); enMap.put('l', 5); enMap.put('5', 5);
enMap.put('m', 6); enMap.put('n', 6); enMap.put('ñ', 6); enMap.put('o', 6);
enMap.put('ó', 6); enMap.put('ö', 6); enMap.put('ô', 6); enMap.put('6', 6);
enMap.put('p', 7); enMap.put('q', 7); enMap.put('r', 7); enMap.put('s', 7);
enMap.put('7', 7);
enMap.put('t', 8); enMap.put('u', 8); enMap.put('û', 6); enMap.put('ü', 8);
enMap.put('v', 8); enMap.put('8', 8); enMap.put('w', 9);
enMap.put('x', 9); enMap.put('y', 9); enMap.put('z', 9);
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('æ', 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);
// Russian
Map<Character, Integer> ruMap = new HashMap<Character, Integer>();
ruMap.put('.', 1); ruMap.put(',', 1); ruMap.put('!', 1); ruMap.put('?', 1);
ruMap.put('-', 1); ruMap.put('"', 1); ruMap.put('\'', 1); ruMap.put('@', 1);
ruMap.put('#', 1); ruMap.put('$', 1); ruMap.put('%', 1); ruMap.put('&', 1);
ruMap.put('*', 1); ruMap.put('(', 1); ruMap.put(')', 1); ruMap.put(':', 1);
ruMap.put(';', 1); ruMap.put('/', 1); ruMap.put('+', 1); ruMap.put('=', 1);
ruMap.put('<', 1); ruMap.put('>', 1); ruMap.put('^', 1); ruMap.put('_', 1);
ruMap.put('~', 1); ruMap.put('1', 1);
ruMap.put('а', 2); ruMap.put('б', 2); ruMap.put('в', 2); ruMap.put('г', 2);
ruMap.put('2', 2);
ruMap.put('д', 3); ruMap.put('е', 3); ruMap.put('ё', 3); ruMap.put('ж', 3);
ruMap.put('з', 3); ruMap.put('3', 3);
ruMap.put('и', 4); ruMap.put('й', 4); ruMap.put('к', 4); ruMap.put('л', 4);
ruMap.put('4', 4);
ruMap.put('м', 5); ruMap.put('н', 5); ruMap.put('о', 5); ruMap.put('п', 5);
ruMap.put('5', 5);
ruMap.put('р', 6); ruMap.put('с', 6); ruMap.put('т', 6); ruMap.put('у', 6);
ruMap.put('6', 6);
ruMap.put('ф', 7); ruMap.put('х', 7); ruMap.put('ц', 7); ruMap.put('ч', 7);
ruMap.put('7', 7);
ruMap.put('ш', 8); ruMap.put('щ', 8); ruMap.put('ъ', 8); ruMap.put('ы', 8);
ruMap.put('8', 8);
ruMap.put('ь', 9); ruMap.put('э', 9); ruMap.put('ю', 9); ruMap.put('я', 9);
ruMap.put('9', 9);
ruMap.put('+', 0);
ruMap.put('0', 0);
CHARTABLE.add(1, Collections.unmodifiableMap(ruMap));
// Russian
Map<Character, Integer> ruMap = new HashMap<Character, Integer>();
ruMap.put('.', 1); ruMap.put(',', 1); ruMap.put('!', 1); ruMap.put('?', 1);
ruMap.put('-', 1); ruMap.put('"', 1); ruMap.put('\'', 1); ruMap.put('@', 1);
ruMap.put('#', 1); ruMap.put('$', 1); ruMap.put('%', 1); ruMap.put('&', 1);
ruMap.put('*', 1); ruMap.put('(', 1); ruMap.put(')', 1); ruMap.put(':', 1);
ruMap.put(';', 1); ruMap.put('/', 1); ruMap.put('+', 1); ruMap.put('=', 1);
ruMap.put('<', 1); ruMap.put('>', 1); ruMap.put('^', 1); ruMap.put('_', 1);
ruMap.put('~', 1); ruMap.put('1', 1);
ruMap.put('а', 2); ruMap.put('б', 2); ruMap.put('в', 2); ruMap.put('г', 2);
ruMap.put('2', 2);
ruMap.put('д', 3); ruMap.put('е', 3); ruMap.put('ё', 3); ruMap.put('ж', 3);
ruMap.put('з', 3); ruMap.put('3', 3);
ruMap.put('и', 4); ruMap.put('й', 4); ruMap.put('к', 4); ruMap.put('л', 4);
ruMap.put('4', 4);
ruMap.put('м', 5); ruMap.put('н', 5); ruMap.put('о', 5); ruMap.put('п', 5);
ruMap.put('5', 5);
ruMap.put('р', 6); ruMap.put('с', 6); ruMap.put('т', 6); ruMap.put('у', 6);
ruMap.put('6', 6);
ruMap.put('ф', 7); ruMap.put('х', 7); ruMap.put('ц', 7); ruMap.put('ч', 7);
ruMap.put('7', 7);
ruMap.put('ш', 8); ruMap.put('щ', 8); ruMap.put('ъ', 8); ruMap.put('ы', 8);
ruMap.put('8', 8);
ruMap.put('ь', 9); ruMap.put('э', 9); ruMap.put('ю', 9); ruMap.put('я', 9);
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));
}
CHARTABLE.add(2, Collections.unmodifiableMap(endefritmap));
CHARTABLE.add(3, Collections.unmodifiableMap(endefritmap));
CHARTABLE.add(4, Collections.unmodifiableMap(endefritmap));
}
protected static final char[][] ENT9TABLE = { { '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' }, { ' ', '0', '+' }, { '\n' } }; // LAST TWO SPACE ON 0
protected static final char[][] RUT9TABLE = { { '0', '+' },
{ '.', ',', '?', '!', '"', '/', '-', '@', '$', '%', '&', '*', '#', '(', ')', '_', '1' },
{ 'а', 'б', 'в', 'г', 'А', 'Б', 'В', 'Г', '2' }, { 'д', 'е', 'ё', 'ж', 'з', 'Д', 'Е', 'Ё', 'Ж', 'З', '3' },
{ 'и', 'й', 'к', 'л', 'И', 'Й', 'К', 'Л', '4' }, { 'м', 'н', 'о', 'п', 'М', 'Н', 'О', 'П', '5' },
{ 'р', 'с', 'т', 'у', 'Р', 'С', 'Т', 'У', '6' }, { 'ф', 'х', 'ц', 'ч', 'Ф', 'Х', 'Ц', 'Ч', '7' },
{ 'ш', 'щ', 'ъ', 'ы', 'Ш', 'Щ', 'Ъ', 'Ы', '8' }, { 'ь', 'э', 'ю', 'я', 'Ь', 'Э', 'Ю', 'Я', '9' },
{ ' ', '\n' }, { ' ', '0', '+' }, { '\n' } }; // LAST TWO SPACE ON 0
protected static final char[][] DET9TABLE = {
{ '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' }, { ' ', '0', '+' }, { '\n' } }; // LAST TWO SPACE ON 0
protected static final char[][] ENT9TABLE = { { '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' }, { ' ', '0', '+' }, { '\n' } }; // LAST TWO SPACE ON 0
protected static final char[][] RUT9TABLE = { { '0', '+' },
{ '.', ',', '?', '!', '"', '/', '-', '@', '$', '%', '&', '*', '#', '(', ')', '_', '1' },
{ 'а', 'б', 'в', 'г', 'А', 'Б', 'В', 'Г', '2' }, { 'д', 'е', 'ё', 'ж', 'з', 'Д', 'Е', 'Ё', 'Ж', 'З', '3' },
{ 'и', 'й', 'к', 'л', 'И', 'Й', 'К', 'Л', '4' }, { 'м', 'н', 'о', 'п', 'М', 'Н', 'О', 'П', '5' },
{ 'р', 'с', 'т', 'у', 'Р', 'С', 'Т', 'У', '6' }, { 'ф', 'х', 'ц', 'ч', 'Ф', 'Х', 'Ц', 'Ч', '7' },
{ 'ш', 'щ', 'ъ', 'ы', 'Ш', 'Щ', 'Ъ', 'Ы', '8' }, { 'ь', 'э', 'ю', 'я', 'Ь', 'Э', 'Ю', 'Я', '9' },
{ ' ', '\n' }, { ' ', '0', '+' }, { '\n' } }; // LAST TWO SPACE ON 0
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' },
{ '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' }, { ' ', '0', '+' }, { '\n' } }; // LAST TWO SPACE ON 0
protected static final char[][] DET9TABLE = {
{ ' ', '+', '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[][] ITT9TABLE = {
{ '+', '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' }, { ' ', '0', '+' }, { '\n' } }; // LAST TWO SPACE ON 0
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', 'î', 'ï', 'Î', 'Ï' },
{ '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[][] ITT9TABLE = {
{ ' ', '+', '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[][][] T9TABLE = { ENT9TABLE, RUT9TABLE, DET9TABLE, FRT9TABLE, ITT9TABLE };
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, 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 };
protected static final int[] RUT9CAPSTART = { 0, 0, 4, 5, 4, 4, 4, 4, 4, 4, 0, 0, 0 };
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};
// 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 };
protected static final int[] RUT9CAPSTART = { 0, 0, 4, 5, 4, 4, 4, 4, 4, 4, 0, 0, 0 };
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[] 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();
String tword = word.toLowerCase(LangHelper.LOCALES[lang.index]);
for (int i = 0; i < word.length(); i++) {
char c = tword.charAt(i);
Integer z = CharMap.CHARTABLE.get(lang.index).get(c);
if (z == null) {
Log.e("getStringSequence",
"ERROR: " + (int) c + " NOT FOUND FOR [" + lang.name() + "] (" + Integer.toHexString((int) c) + ") Index: " + i);
throw new NullPointerException();
}
seq.append(z.toString());
}
return seq.toString();
}
protected static String getStringSequence(String word, LANGUAGE lang) {
StringBuilder seq = new StringBuilder();
String tword = word.toLowerCase(LangHelper.LOCALES[lang.index]);
for (int i = 0; i < word.length(); i++) {
char c = tword.charAt(i);
Integer z = CharMap.CHARTABLE.get(lang.index).get(c);
if (z == null) {
Log.e("getStringSequence",
"ERROR: " + (int) c + " NOT FOUND FOR [" + lang.name() + "] (" + Integer.toHexString((int) c) + ") Index: " + i);
throw new NullPointerException();
}
seq.append(z.toString());
}
return seq.toString();
}
}

View file

@ -6,111 +6,118 @@ import java.util.Map;
public class LangHelper {
protected static final Locale RUSSIAN = new Locale("ru","RU");
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);
public final int index;
public final int id;
// lookup map
private static final Map<Integer, LANGUAGE> lookup = new HashMap<Integer, LANGUAGE>();
private static final LANGUAGE[] ids = LANGUAGE.values();
static { for (LANGUAGE l : ids) lookup.put(l.id, l); }
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), UK(5,32);
public final int index;
public final int id;
// lookup map
private static final Map<Integer, LANGUAGE> lookup = new HashMap<Integer, LANGUAGE>();
private static final LANGUAGE[] ids = LANGUAGE.values();
static { for (LANGUAGE l : ids) lookup.put(l.id, l); }
private LANGUAGE(int index, int id) { this.index = index; this.id = id; }
private LANGUAGE(int index, int id) { this.index = index; this.id = id; }
public static LANGUAGE get(int i) { return lookup.get(i);}
}
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;
public static final int LANG_DEFAULT = LANGUAGE.EN.id;
protected static final int NLANGS = LANGUAGE.lookup.size();
protected static final int NLANGS = LANGUAGE.lookup.size();
protected static String getString(int lang) {
protected static String getString(int lang) {
return LANGUAGE.get(lang).name();
}
protected static int getIndex(LANGUAGE l) {
return l.index;
}
protected static int getIndex(LANGUAGE l) {
return l.index;
}
//[LANG][MODE][CAPSMODE] = iconref
// first group en, first line LANG, second line TEXT, last line NUM
protected static final int[][][] ICONMAP = {
{
//English resources
{R.drawable.ime_en_lang_lower, R.drawable.ime_en_lang_single, R.drawable.ime_en_lang_upper},
{R.drawable.ime_en_text_lower, R.drawable.ime_en_text_single, R.drawable.ime_en_text_upper},
{R.drawable.ime_number},
},
{
// Russian resources
{R.drawable.ime_ru_lang_lower, R.drawable.ime_ru_lang_single, R.drawable.ime_ru_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
},
{
// German resources
{R.drawable.ime_de_lang_lower, R.drawable.ime_de_lang_single, R.drawable.ime_de_lang_upper}, //LANG
{R.drawable.ime_en_text_lower, R.drawable.ime_en_text_single, R.drawable.ime_en_text_upper}, //TEXT
{R.drawable.ime_number}, //NUM
},
{
// French resources
{R.drawable.ime_fr_lang_lower, R.drawable.ime_fr_lang_single, R.drawable.ime_fr_lang_upper}, //LANG
{R.drawable.ime_en_text_lower, R.drawable.ime_en_text_single, R.drawable.ime_en_text_upper}, //TEXT
{R.drawable.ime_number}, //NUM
},
{
// Italian resources
{R.drawable.ime_it_lang_lower, R.drawable.ime_it_lang_single, R.drawable.ime_it_lang_upper}, //LANG
{R.drawable.ime_en_text_lower, R.drawable.ime_en_text_single, R.drawable.ime_en_text_upper}, //TEXT
{R.drawable.ime_number}, //NUM
},
{
//English resources
{R.drawable.ime_en_lang_lower, R.drawable.ime_en_lang_single, R.drawable.ime_en_lang_upper},
{R.drawable.ime_en_text_lower, R.drawable.ime_en_text_single, R.drawable.ime_en_text_upper},
{R.drawable.ime_number},
},
{
// Russian resources
{R.drawable.ime_ru_lang_lower, R.drawable.ime_ru_lang_single, R.drawable.ime_ru_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
},
{
// German resources
{R.drawable.ime_de_lang_lower, R.drawable.ime_de_lang_single, R.drawable.ime_de_lang_upper}, //LANG
{R.drawable.ime_en_text_lower, R.drawable.ime_en_text_single, R.drawable.ime_en_text_upper}, //TEXT
{R.drawable.ime_number}, //NUM
},
{
// French resources
{R.drawable.ime_fr_lang_lower, R.drawable.ime_fr_lang_single, R.drawable.ime_fr_lang_upper}, //LANG
{R.drawable.ime_en_text_lower, R.drawable.ime_en_text_single, R.drawable.ime_en_text_upper}, //TEXT
{R.drawable.ime_number}, //NUM
},
{
// Italian resources
{R.drawable.ime_it_lang_lower, R.drawable.ime_it_lang_single, R.drawable.ime_it_lang_upper}, //LANG
{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) {
int num = 0;
//calc size of filtered array
for (LANGUAGE l : LANGUAGE.ids) {
if ((i & l.id) == l.id) {
num++;
}
}
LANGUAGE[] la = new LANGUAGE[num];
int lai = 0;
for (LANGUAGE l : LANGUAGE.ids) {
if ((i & l.id) == l.id) {
la[lai] = l;
lai++;
}
}
return la;
}
public static LANGUAGE[] buildLangs(int i) {
int num = 0;
//calc size of filtered array
for (LANGUAGE l : LANGUAGE.ids) {
if ((i & l.id) == l.id) {
num++;
}
}
LANGUAGE[] la = new LANGUAGE[num];
int lai = 0;
for (LANGUAGE l : LANGUAGE.ids) {
if ((i & l.id) == l.id) {
la[lai] = l;
lai++;
}
}
return la;
}
public static int shrinkLangs(LANGUAGE[] langs) {
int i = 0;
for (LANGUAGE l : langs)
i = i | l.id;
return i;
}
public static int shrinkLangs(int[] langs) {
int i = 0;
for (int l : langs)
i = i | l;
return i;
}
public static int shrinkLangs(LANGUAGE[] langs) {
int i = 0;
for (LANGUAGE l : langs)
i = i | l.id;
return i;
}
public static int shrinkLangs(int[] langs) {
int i = 0;
for (int l : langs)
i = i | l;
return i;
}
protected static int findIndex(LANGUAGE[] ia, LANGUAGE target) {
for (int x=0; x<ia.length; x++) {
if (ia[x] == target)
return x;
}
return 0;
}
protected static int findIndex(LANGUAGE[] ia, LANGUAGE target) {
for (int x=0; x<ia.length; x++) {
if (ia[x] == target)
return x;
}
return 0;
}
}

View file

@ -0,0 +1,23 @@
Title
Traditional T9 Keypad IME
Full description
Це метод введення тексту з передбаченням (T9) з використанням апаратної клавіатури.
Це НЕ програмна/екранна клавіатура.
Цю клавіатуру має сенс встановлювати лише на телефон з апаратною клавіатурою.
Введення здійснються ЛИШЕ з цифрової апаратної клавіатури.
Детальна інформація та підтримка на веб-сайті.
Підтримується декілька мов введення (Англійська, Російська, Німецька, Французька, Італійська, Українська)
Short description
Введення тексту з передбаченням (T9) з апаратної клавіатури! (Англійська, Російська, Німецька, Французька, Італійська, Українська)
Що нового в цій версії?
Нова мова введення (Українська)
Інші виправлення та новини.
Історія змін на github.