From 59e795ca3fcb91ea11cc328a1370a7c49a4017be Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 8 Jul 2014 22:05:39 +0900 Subject: [PATCH] Add Malayalam keyboard Bug: 10417006 Change-Id: Ieb03fe1f08c85417b5d9ad4d62c8a5bc6d0632bc --- java/res/xml-sw600dp/rows_malayalam.xml | 49 +++++ java/res/xml/kbd_malayalam.xml | 26 +++ .../res/xml/keyboard_layout_set_malayalam.xml | 42 ++++ java/res/xml/method.xml | 11 + java/res/xml/rowkeys_malayalam1.xml | 100 ++++++++++ java/res/xml/rowkeys_malayalam2.xml | 77 +++++++ java/res/xml/rowkeys_malayalam3.xml | 76 +++++++ java/res/xml/rows_malayalam.xml | 45 +++++ .../keyboard/internal/KeyboardTextsTable.java | 158 ++++++++------- .../KeyboardLayoutSetSubtypesCountTests.java | 2 +- .../keyboard/layout/Malayalam.java | 188 ++++++++++++++++++ .../layout/tests/TestsMalayalamIN.java | 37 ++++ .../donottranslate-more-keys.xml | 26 +++ 13 files changed, 766 insertions(+), 71 deletions(-) create mode 100644 java/res/xml-sw600dp/rows_malayalam.xml create mode 100644 java/res/xml/kbd_malayalam.xml create mode 100644 java/res/xml/keyboard_layout_set_malayalam.xml create mode 100644 java/res/xml/rowkeys_malayalam1.xml create mode 100644 java/res/xml/rowkeys_malayalam2.xml create mode 100644 java/res/xml/rowkeys_malayalam3.xml create mode 100644 java/res/xml/rows_malayalam.xml create mode 100644 tests/src/com/android/inputmethod/keyboard/layout/Malayalam.java create mode 100644 tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMalayalamIN.java create mode 100644 tools/make-keyboard-text/res/values-ml-rIN/donottranslate-more-keys.xml diff --git a/java/res/xml-sw600dp/rows_malayalam.xml b/java/res/xml-sw600dp/rows_malayalam.xml new file mode 100644 index 000000000..1df7e6ea6 --- /dev/null +++ b/java/res/xml-sw600dp/rows_malayalam.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + diff --git a/java/res/xml/kbd_malayalam.xml b/java/res/xml/kbd_malayalam.xml new file mode 100644 index 000000000..000b23f82 --- /dev/null +++ b/java/res/xml/kbd_malayalam.xml @@ -0,0 +1,26 @@ + + + + + + diff --git a/java/res/xml/keyboard_layout_set_malayalam.xml b/java/res/xml/keyboard_layout_set_malayalam.xml new file mode 100644 index 000000000..14c76baf0 --- /dev/null +++ b/java/res/xml/keyboard_layout_set_malayalam.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml index 7a6640bcc..6d4d3f26b 100644 --- a/java/res/xml/method.xml +++ b/java/res/xml/method.xml @@ -68,6 +68,7 @@ lt: Lithuanian/qwerty lv: Latvian/qwerty mk: Macedonian/south_slavic + (ml_IN: Malayalam (India)/malayalam) # This is a preliminary keyboard layout. mn_MN: Mongolian (Mongolia)/mongolian (mr_IN: Marathi (India)/marathi) # This is a preliminary keyboard layout. ms_MY: Malay (Malaysia)/qwerty @@ -483,6 +484,16 @@ android:imeSubtypeExtraValue="KeyboardLayoutSet=south_slavic,EmojiCapable" android:isAsciiCapable="false" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/res/xml/rowkeys_malayalam2.xml b/java/res/xml/rowkeys_malayalam2.xml new file mode 100644 index 000000000..f0f9df025 --- /dev/null +++ b/java/res/xml/rowkeys_malayalam2.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/res/xml/rowkeys_malayalam3.xml b/java/res/xml/rowkeys_malayalam3.xml new file mode 100644 index 000000000..6959ccda1 --- /dev/null +++ b/java/res/xml/rowkeys_malayalam3.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/res/xml/rows_malayalam.xml b/java/res/xml/rows_malayalam.xml new file mode 100644 index 000000000..5e7a4916c --- /dev/null +++ b/java/res/xml/rows_malayalam.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java index 8b8a9dd2a..4c8c37ae8 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java @@ -88,7 +88,7 @@ public final class KeyboardTextsTable { /* 2:30 */ "morekeys_u", /* 3:29 */ "morekeys_e", /* 4:28 */ "morekeys_i", - /* 5:25 */ "keylabel_to_alpha", + /* 5:26 */ "keylabel_to_alpha", /* 6:23 */ "morekeys_c", /* 7:23 */ "double_quotes", /* 8:22 */ "morekeys_n", @@ -96,8 +96,8 @@ public final class KeyboardTextsTable { /* 10:20 */ "morekeys_s", /* 11:14 */ "morekeys_y", /* 12:13 */ "morekeys_d", - /* 13:12 */ "morekeys_z", - /* 14:12 */ "keyspec_currency", + /* 13:13 */ "keyspec_currency", + /* 14:12 */ "morekeys_z", /* 15:10 */ "morekeys_t", /* 16:10 */ "morekeys_l", /* 17: 9 */ "morekeys_g", @@ -267,11 +267,11 @@ public final class KeyboardTextsTable { /* morekeys_n */ EMPTY, /* single_quotes */ "!text/single_lqm_rqm", /* morekeys_s ~ */ - EMPTY, EMPTY, EMPTY, EMPTY, - /* ~ morekeys_z */ - /* keyspec_currency */ "$", - /* morekeys_t ~ */ EMPTY, EMPTY, EMPTY, + /* ~ morekeys_d */ + /* keyspec_currency */ "$", + /* morekeys_z ~ */ + EMPTY, EMPTY, EMPTY, EMPTY, /* ~ morekeys_g */ /* single_angle_quotes */ "!text/single_laqm_raqm", /* double_angle_quotes */ "!text/double_laqm_raqm", @@ -764,8 +764,8 @@ public final class KeyboardTextsTable { // U+0997: "ग" BENGALI LETTER GA /* keylabel_to_alpha */ "\u0995\u0996\u0997", /* morekeys_c ~ */ - null, null, null, null, null, null, null, null, - /* ~ morekeys_z */ + null, null, null, null, null, null, null, + /* ~ morekeys_d */ // U+09F3: "৳" BENGALI RUPEE SIGN /* keyspec_currency */ "\u09F3", }; @@ -909,11 +909,11 @@ public final class KeyboardTextsTable { /* morekeys_y */ "\u00FD,\u00FF", // U+010F: "ď" LATIN SMALL LETTER D WITH CARON /* morekeys_d */ "\u010F", + /* keyspec_currency */ null, // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE /* morekeys_z */ "\u017E,\u017A,\u017C", - /* keyspec_currency */ null, // U+0165: "ť" LATIN SMALL LETTER T WITH CARON /* morekeys_t */ "\u0165", /* morekeys_l */ null, @@ -968,7 +968,7 @@ public final class KeyboardTextsTable { /* morekeys_y */ "\u00FD,\u00FF", // U+00F0: "ð" LATIN SMALL LETTER ETH /* morekeys_d */ "\u00F0", - /* morekeys_z ~ */ + /* keyspec_currency ~ */ null, null, null, /* ~ morekeys_t */ // U+0142: "ł" LATIN SMALL LETTER L WITH STROKE @@ -1209,11 +1209,11 @@ public final class KeyboardTextsTable { // U+010F: "ď" LATIN SMALL LETTER D WITH CARON // U+0111: "đ" LATIN SMALL LETTER D WITH STROKE /* morekeys_d */ "\u00F0,\u010F,\u0111", + /* keyspec_currency */ null, // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON /* morekeys_z */ "\u017A,\u017C,\u017E", - /* keyspec_currency */ null, // U+0165: "ť" LATIN SMALL LETTER T WITH CARON // U+021B: "ț" LATIN SMALL LETTER T WITH COMMA BELOW // U+0163: "ţ" LATIN SMALL LETTER T WITH CEDILLA @@ -1403,11 +1403,11 @@ public final class KeyboardTextsTable { /* morekeys_y */ "\u00FD,\u00FF", // U+010F: "ď" LATIN SMALL LETTER D WITH CARON /* morekeys_d */ "\u010F", + /* keyspec_currency */ null, // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE /* morekeys_z */ "\u017E,\u017C,\u017A", - /* keyspec_currency */ null, // U+0163: "ţ" LATIN SMALL LETTER T WITH CEDILLA // U+0165: "ť" LATIN SMALL LETTER T WITH CARON /* morekeys_t */ "\u0163,\u0165", @@ -1505,13 +1505,13 @@ public final class KeyboardTextsTable { // U+067E: "پ" ARABIC LETTER PEH /* keylabel_to_alpha */ "\u0627\u200C\u0628\u200C\u067E", /* morekeys_c ~ */ - null, null, null, null, null, null, null, null, - /* ~ morekeys_z */ + null, null, null, null, null, null, null, + /* ~ morekeys_d */ // U+FDFC: "﷼" RIAL SIGN /* keyspec_currency */ "\uFDFC", - /* morekeys_t ~ */ + /* morekeys_z ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, + null, null, null, /* ~ morekeys_cyrillic_soft_sign */ // U+06F1: "۱" EXTENDED ARABIC-INDIC DIGIT ONE /* keyspec_symbols_1 */ "\u06F1", @@ -1663,14 +1663,15 @@ public final class KeyboardTextsTable { // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+015B: "ś" LATIN SMALL LETTER S WITH ACUTE /* morekeys_s */ "\u0161,\u00DF,\u015B", - /* morekeys_y */ null, - /* morekeys_d */ null, + /* morekeys_y ~ */ + null, null, null, + /* ~ keyspec_currency */ // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE /* morekeys_z */ "\u017E,\u017A,\u017C", - /* keyspec_currency ~ */ - null, null, null, null, null, null, null, null, null, + /* morekeys_t ~ */ + null, null, null, null, null, null, null, null, /* ~ morekeys_cyrillic_ie */ // U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE /* keyspec_nordic_row1_11 */ "\u00E5", @@ -1826,13 +1827,13 @@ public final class KeyboardTextsTable { // U+0917: "ग" DEVANAGARI LETTER GA /* keylabel_to_alpha */ "\u0915\u0916\u0917", /* morekeys_c ~ */ - null, null, null, null, null, null, null, null, - /* ~ morekeys_z */ + null, null, null, null, null, null, null, + /* ~ morekeys_d */ // U+20B9: "₹" INDIAN RUPEE SIGN /* keyspec_currency */ "\u20B9", - /* morekeys_t ~ */ + /* morekeys_z ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, + null, null, null, /* ~ morekeys_cyrillic_soft_sign */ // U+0967: "१" DEVANAGARI DIGIT ONE /* keyspec_symbols_1 */ "\u0967", @@ -1889,12 +1890,13 @@ public final class KeyboardTextsTable { /* morekeys_y */ null, // U+0111: "đ" LATIN SMALL LETTER D WITH STROKE /* morekeys_d */ "\u0111", + /* keyspec_currency */ null, // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE /* morekeys_z */ "\u017E,\u017A,\u017C", - /* keyspec_currency ~ */ - null, null, null, null, + /* morekeys_t ~ */ + null, null, null, /* ~ morekeys_g */ /* single_angle_quotes */ "!text/single_raqm_laqm", /* double_angle_quotes */ "!text/double_raqm_laqm", @@ -2068,8 +2070,8 @@ public final class KeyboardTextsTable { /* morekeys_y */ "\u00FD,\u00FF", // U+00F0: "ð" LATIN SMALL LETTER ETH /* morekeys_d */ "\u00F0", - /* morekeys_z */ null, /* keyspec_currency */ null, + /* morekeys_z */ null, // U+00FE: "þ" LATIN SMALL LETTER THORN /* morekeys_t */ "\u00FE", }; @@ -2152,15 +2154,15 @@ public final class KeyboardTextsTable { /* morekeys_n */ null, /* single_quotes */ "!text/single_rqm_9qm", /* morekeys_s ~ */ - null, null, null, null, - /* ~ morekeys_z */ + null, null, null, + /* ~ morekeys_d */ // U+20AA: "₪" NEW SHEQEL SIGN /* keyspec_currency */ "\u20AA", - /* morekeys_t ~ */ + /* morekeys_z ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, + null, null, null, /* ~ morekeys_swiss_row2_11 */ // U+2605: "★" BLACK STAR /* morekeys_star */ "\u2605", @@ -2349,8 +2351,8 @@ public final class KeyboardTextsTable { // U+0E84: "ຄ" LAO LETTER KHO TAM /* keylabel_to_alpha */ "\u0E81\u0E82\u0E84", /* morekeys_c ~ */ - null, null, null, null, null, null, null, null, - /* ~ morekeys_z */ + null, null, null, null, null, null, null, + /* ~ morekeys_d */ // U+20AD: "₭" KIP SIGN /* keyspec_currency */ "\u20AD", }; @@ -2424,11 +2426,11 @@ public final class KeyboardTextsTable { /* morekeys_y */ "\u00FD,\u00FF", // U+010F: "ď" LATIN SMALL LETTER D WITH CARON /* morekeys_d */ "\u010F", + /* keyspec_currency */ null, // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE /* morekeys_z */ "\u017E,\u017C,\u017A", - /* keyspec_currency */ null, // U+0163: "ţ" LATIN SMALL LETTER T WITH CEDILLA // U+0165: "ť" LATIN SMALL LETTER T WITH CARON /* morekeys_t */ "\u0163,\u0165", @@ -2518,11 +2520,11 @@ public final class KeyboardTextsTable { /* morekeys_y */ "\u00FD,\u00FF", // U+010F: "ď" LATIN SMALL LETTER D WITH CARON /* morekeys_d */ "\u010F", + /* keyspec_currency */ null, // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE /* morekeys_z */ "\u017E,\u017C,\u017A", - /* keyspec_currency */ null, // U+0163: "ţ" LATIN SMALL LETTER T WITH CEDILLA // U+0165: "ť" LATIN SMALL LETTER T WITH CARON /* morekeys_t */ "\u0163,\u0165", @@ -2582,6 +2584,21 @@ public final class KeyboardTextsTable { /* keyspec_south_slavic_row3_8 */ "\u0453", }; + /* Locale ml_IN: Malayalam (India) */ + private static final String[] TEXTS_ml_IN = { + /* morekeys_a ~ */ + null, null, null, null, null, + /* ~ morekeys_i */ + // Label for "switch to alphabetic" key. + // U+0D05: "അ" MALAYALAM LETTER A + /* keylabel_to_alpha */ "\u0D05", + /* morekeys_c ~ */ + null, null, null, null, null, null, null, + /* ~ morekeys_d */ + // U+20B9: "₹" INDIAN RUPEE SIGN + /* keyspec_currency */ "\u20B9", + }; + /* Locale mn_MN: Mongolian (Mongolia) */ private static final String[] TEXTS_mn_MN = { /* morekeys_a ~ */ @@ -2593,8 +2610,8 @@ public final class KeyboardTextsTable { // U+0412: "В" CYRILLIC CAPITAL LETTER VE /* keylabel_to_alpha */ "\u0410\u0411\u0412", /* morekeys_c ~ */ - null, null, null, null, null, null, null, null, - /* ~ morekeys_z */ + null, null, null, null, null, null, null, + /* ~ morekeys_d */ // U+20AE: "₮" TUGRIK SIGN /* keyspec_currency */ "\u20AE", }; @@ -2610,13 +2627,13 @@ public final class KeyboardTextsTable { // U+0917: "ग" DEVANAGARI LETTER GA /* keylabel_to_alpha */ "\u0915\u0916\u0917", /* morekeys_c ~ */ - null, null, null, null, null, null, null, null, - /* ~ morekeys_z */ + null, null, null, null, null, null, null, + /* ~ morekeys_d */ // U+20B9: "₹" INDIAN RUPEE SIGN /* keyspec_currency */ "\u20B9", - /* morekeys_t ~ */ + /* morekeys_z ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, + null, null, null, /* ~ morekeys_cyrillic_soft_sign */ // U+0967: "१" DEVANAGARI DIGIT ONE /* keyspec_symbols_1 */ "\u0967", @@ -2757,13 +2774,13 @@ public final class KeyboardTextsTable { // U+0917: "ग" DEVANAGARI LETTER GA /* keylabel_to_alpha */ "\u0915\u0916\u0917", /* morekeys_c ~ */ - null, null, null, null, null, null, null, null, - /* ~ morekeys_z */ + null, null, null, null, null, null, null, + /* ~ morekeys_d */ // U+0930/U+0941/U+002E "रु." NEPALESE RUPEE SIGN /* keyspec_currency */ "\u0930\u0941.", - /* morekeys_t ~ */ + /* morekeys_z ~ */ null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, + null, null, null, /* ~ morekeys_cyrillic_soft_sign */ // U+0967: "१" DEVANAGARI DIGIT ONE /* keyspec_symbols_1 */ "\u0967", @@ -2898,13 +2915,13 @@ public final class KeyboardTextsTable { // U+00DF: "ß" LATIN SMALL LETTER SHARP S // U+0161: "š" LATIN SMALL LETTER S WITH CARON /* morekeys_s */ "\u015B,\u00DF,\u0161", - /* morekeys_y */ null, - /* morekeys_d */ null, + /* morekeys_y ~ */ + null, null, null, + /* ~ keyspec_currency */ // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON /* morekeys_z */ "\u017C,\u017A,\u017E", - /* keyspec_currency */ null, /* morekeys_t */ null, // U+0142: "ł" LATIN SMALL LETTER L WITH STROKE /* morekeys_l */ "\u0142", @@ -3006,7 +3023,7 @@ public final class KeyboardTextsTable { /* morekeys_s */ "\u0219,\u00DF,\u015B,\u0161", /* morekeys_y ~ */ null, null, null, null, - /* ~ keyspec_currency */ + /* ~ morekeys_z */ // U+021B: "ț" LATIN SMALL LETTER T WITH COMMA BELOW /* morekeys_t */ "\u021B", }; @@ -3125,11 +3142,11 @@ public final class KeyboardTextsTable { /* morekeys_y */ "\u00FD,\u00FF", // U+010F: "ď" LATIN SMALL LETTER D WITH CARON /* morekeys_d */ "\u010F", + /* keyspec_currency */ null, // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE /* morekeys_z */ "\u017E,\u017C,\u017A", - /* keyspec_currency */ null, // U+0165: "ť" LATIN SMALL LETTER T WITH CARON // U+0163: "ţ" LATIN SMALL LETTER T WITH CEDILLA /* morekeys_t */ "\u0165,\u0163", @@ -3167,10 +3184,11 @@ public final class KeyboardTextsTable { /* morekeys_y */ null, // U+0111: "đ" LATIN SMALL LETTER D WITH STROKE /* morekeys_d */ "\u0111", + /* keyspec_currency */ null, // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON /* morekeys_z */ "\u017E", - /* keyspec_currency ~ */ - null, null, null, null, + /* morekeys_t ~ */ + null, null, null, /* ~ morekeys_g */ /* single_angle_quotes */ "!text/single_raqm_laqm", /* double_angle_quotes */ "!text/double_raqm_laqm", @@ -3290,11 +3308,11 @@ public final class KeyboardTextsTable { // U+00F0: "ð" LATIN SMALL LETTER ETH // U+010F: "ď" LATIN SMALL LETTER D WITH CARON /* morekeys_d */ "\u00F0,\u010F", + /* keyspec_currency */ null, // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE /* morekeys_z */ "\u017A,\u017E,\u017C", - /* keyspec_currency */ null, // U+0165: "ť" LATIN SMALL LETTER T WITH CARON // U+00FE: "þ" LATIN SMALL LETTER THORN /* morekeys_t */ "\u0165,\u00FE", @@ -3389,8 +3407,8 @@ public final class KeyboardTextsTable { // U+0BB4/U+0BCD: "ழ்" TAMIL LETTER LLLA/TAMIL SIGN VIRAMA /* keylabel_to_alpha */ "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD", /* morekeys_c ~ */ - null, null, null, null, null, null, null, null, - /* ~ morekeys_z */ + null, null, null, null, null, null, null, + /* ~ morekeys_d */ // U+0BF9: "௹" TAMIL RUPEE SIGN /* keyspec_currency */ "\u0BF9", }; @@ -3406,8 +3424,8 @@ public final class KeyboardTextsTable { // U+0E04: "ค" THAI CHARACTER KHO KHWAI /* keylabel_to_alpha */ "\u0E01\u0E02\u0E04", /* morekeys_c ~ */ - null, null, null, null, null, null, null, null, - /* ~ morekeys_z */ + null, null, null, null, null, null, null, + /* ~ morekeys_d */ // U+0E3F: "฿" THAI CURRENCY SYMBOL BAHT /* keyspec_currency */ "\u0E3F", }; @@ -3530,12 +3548,12 @@ public final class KeyboardTextsTable { /* morekeys_n */ null, /* single_quotes */ "!text/single_9qm_lqm", /* morekeys_s ~ */ - null, null, null, null, - /* ~ morekeys_z */ + null, null, null, + /* ~ morekeys_d */ // U+20B4: "₴" HRYVNIA SIGN /* keyspec_currency */ "\u20B4", - /* morekeys_t ~ */ - null, null, null, null, null, null, null, null, null, null, null, null, + /* morekeys_z ~ */ + null, null, null, null, null, null, null, null, null, null, null, null, null, /* ~ morekeys_nordic_row2_10 */ // U+0449: "щ" CYRILLIC SMALL LETTER SHCHA /* keyspec_east_slavic_row1_9 */ "\u0449", @@ -3640,7 +3658,6 @@ public final class KeyboardTextsTable { /* morekeys_y */ "\u1EF3,\u00FD,\u1EF7,\u1EF9,\u1EF5", // U+0111: "đ" LATIN SMALL LETTER D WITH STROKE /* morekeys_d */ "\u0111", - /* morekeys_z */ null, // U+20AB: "₫" DONG SIGN /* keyspec_currency */ "\u20AB", }; @@ -3785,11 +3802,11 @@ public final class KeyboardTextsTable { // U+0111: "đ" LATIN SMALL LETTER D WITH STROKE // U+00F0: "ð" LATIN SMALL LETTER ETH /* morekeys_d */ "\u010F,\u0111,\u00F0", + /* keyspec_currency */ null, // U+017A: "ź" LATIN SMALL LETTER Z WITH ACUTE // U+017C: "ż" LATIN SMALL LETTER Z WITH DOT ABOVE // U+017E: "ž" LATIN SMALL LETTER Z WITH CARON /* morekeys_z */ "\u017A,\u017C,\u017E", - /* keyspec_currency */ null, // U+00FE: "þ" LATIN SMALL LETTER THORN // U+0163: "ţ" LATIN SMALL LETTER T WITH CEDILLA // U+0165: "ť" LATIN SMALL LETTER T WITH CARON @@ -3841,7 +3858,7 @@ public final class KeyboardTextsTable { "az_AZ" , TEXTS_az_AZ, /* 8/ 18 Azerbaijani (Azerbaijan) */ "be_BY" , TEXTS_be_BY, /* 9/ 32 Belarusian (Belarus) */ "bg" , TEXTS_bg, /* 2/ 8 Bulgarian */ - "bn_IN" , TEXTS_bn_IN, /* 2/ 15 Bengali (India) */ + "bn_IN" , TEXTS_bn_IN, /* 2/ 14 Bengali (India) */ "ca" , TEXTS_ca, /* 11/ 96 Catalan */ "cs" , TEXTS_cs, /* 17/ 21 Czech */ "da" , TEXTS_da, /* 19/ 54 Danish */ @@ -3867,11 +3884,12 @@ public final class KeyboardTextsTable { "kk" , TEXTS_kk, /* 15/121 Kazakh */ "km_KH" , TEXTS_km_KH, /* 2/122 Khmer (Cambodia) */ "ky" , TEXTS_ky, /* 10/ 89 Kirghiz */ - "lo_LA" , TEXTS_lo_LA, /* 2/ 15 Lao (Laos) */ + "lo_LA" , TEXTS_lo_LA, /* 2/ 14 Lao (Laos) */ "lt" , TEXTS_lt, /* 18/ 22 Lithuanian */ "lv" , TEXTS_lv, /* 18/ 22 Latvian */ "mk" , TEXTS_mk, /* 9/ 94 Macedonian */ - "mn_MN" , TEXTS_mn_MN, /* 2/ 15 Mongolian (Mongolia) */ + "ml_IN" , TEXTS_ml_IN, /* 2/ 14 Malayalam (India) */ + "mn_MN" , TEXTS_mn_MN, /* 2/ 14 Mongolian (Mongolia) */ "mr_IN" , TEXTS_mr_IN, /* 23/ 53 Marathi (India) */ "my_MM" , TEXTS_my_MM, /* 8/104 Burmese (Myanmar) */ "nb" , TEXTS_nb, /* 11/ 54 Norwegian Bokmål */ @@ -3888,12 +3906,12 @@ public final class KeyboardTextsTable { "sr" , TEXTS_sr, /* 11/ 94 Serbian */ "sv" , TEXTS_sv, /* 21/ 54 Swedish */ "sw" , TEXTS_sw, /* 9/ 18 Swahili */ - "ta_IN" , TEXTS_ta_IN, /* 2/ 15 Tamil (India) */ - "th" , TEXTS_th, /* 2/ 15 Thai */ + "ta_IN" , TEXTS_ta_IN, /* 2/ 14 Tamil (India) */ + "th" , TEXTS_th, /* 2/ 14 Thai */ "tl" , TEXTS_tl, /* 7/ 9 Tagalog */ "tr" , TEXTS_tr, /* 7/ 18 Turkish */ "uk" , TEXTS_uk, /* 11/ 88 Ukrainian */ - "vi" , TEXTS_vi, /* 8/ 15 Vietnamese */ + "vi" , TEXTS_vi, /* 8/ 14 Vietnamese */ "zu" , TEXTS_zu, /* 8/ 11 Zulu */ "zz" , TEXTS_zz, /* 19/112 Alphabet */ }; diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java index 67b87200f..056fe1bd6 100644 --- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java +++ b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java @@ -25,7 +25,7 @@ import java.util.ArrayList; @SmallTest public class KeyboardLayoutSetSubtypesCountTests extends KeyboardLayoutSetTestsBase { - private static final int NUMBER_OF_SUBTYPES = 74; + private static final int NUMBER_OF_SUBTYPES = 75; private static final int NUMBER_OF_ASCII_CAPABLE_SUBTYPES = 45; private static final int NUMBER_OF_PREDEFINED_ADDITIONAL_SUBTYPES = 2; diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Malayalam.java b/tests/src/com/android/inputmethod/keyboard/layout/Malayalam.java new file mode 100644 index 000000000..b44b888e1 --- /dev/null +++ b/tests/src/com/android/inputmethod/keyboard/layout/Malayalam.java @@ -0,0 +1,188 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.inputmethod.keyboard.layout; + +import com.android.inputmethod.keyboard.layout.expected.ExpectedKey; +import com.android.inputmethod.keyboard.layout.expected.ExpectedKeyboardBuilder; +import com.android.inputmethod.latin.Constants; + +import java.util.Locale; + +/** + * The Malayalam keyboard. + */ +public final class Malayalam extends LayoutBase { + private static final String LAYOUT_NAME = "malayalam"; + + public Malayalam(final LayoutCustomizer customizer) { + super(customizer, Symbols.class, SymbolsShifted.class); + } + + @Override + public String getName() { return LAYOUT_NAME; } + + public static class MalayalamCustomizer extends LayoutCustomizer { + public MalayalamCustomizer(final Locale locale) { super(locale); } + + @Override + public ExpectedKey getAlphabetKey() { return MALAYALAM_ALPHABET_KEY; } + + @Override + public ExpectedKey getCurrencyKey() { return CURRENCY_RUPEE; } + + @Override + public ExpectedKey[] getOtherCurrencyKeys() { + return SymbolsShifted.CURRENCIES_OTHER_GENERIC; + } + + @Override + public ExpectedKey[] getLeftShiftKeys(final boolean isPhone) { + return EMPTY_KEYS; + } + + @Override + public ExpectedKey[] getRightShiftKeys(final boolean isPhone) { + return isPhone ? EMPTY_KEYS : EXCLAMATION_AND_QUESTION_MARKS; + } + + // U+0D05: "അ" MALAYALAM LETTER A + private static final ExpectedKey MALAYALAM_ALPHABET_KEY = key( + "\u0D05", Constants.CODE_SWITCH_ALPHA_SYMBOL); + + // U+20B9: "₹" INDIAN RUPEE SIGN + private static final ExpectedKey CURRENCY_RUPEE = key("\u20B9", + Symbols.CURRENCY_GENERIC_MORE_KEYS); + } + + @Override + ExpectedKey[][] getCommonAlphabetLayout(boolean isPhone) { return ALPHABET_COMMON; } + + @Override + ExpectedKey[][] getCommonAlphabetShiftLayout(boolean isPhone, final int elementId) { + return null; + } + + private static final ExpectedKey[][] ALPHABET_COMMON = new ExpectedKeyboardBuilder() + .setKeysOfRow(1, + // U+0D4D: "്" MALAYALAM SIGN VIRAMA + // U+0D05: "അ" MALAYALAM LETTER A + key("\u0D4D", joinMoreKeys("\u0D05", "1")), + // U+0D3E: "ാ" MALAYALAM VOWEL SIGN AA + // U+0D06: "ആ" MALAYALAM LETTER AA + key("\u0D3E", joinMoreKeys("\u0D06", "2")), + // U+0D3F: "ി" MALAYALAM VOWEL SIGN I + // U+0D07: "ഇ" MALAYALAM LETTER I + key("\u0D3F", joinMoreKeys("\u0D07", "3")), + // U+0D40: "ീ" MALAYALAM VOWEL SIGN II + // U+0D08: "ഈ" MALAYALAM LETTER II + key("\u0D40", joinMoreKeys("\u0D08", "4")), + // U+0D41: "ു" MALAYALAM VOWEL SIGN U + // U+0D09: "ഉ" MALAYALAM LETTER U + key("\u0D41", joinMoreKeys("\u0D09", "5")), + // U+0D42: "ൂ" MALAYALAM VOWEL SIGN UU + // U+0D0A: "ഊ" MALAYALAM LETTER UU + key("\u0D42", joinMoreKeys("\u0D0A", "6")), + // U+0D43: "ൃ" MALAYALAM VOWEL SIGN VOCALIC R + // U+0D0B: "ഋ" MALAYALAM LETTER VOCALIC R + key("\u0D43", joinMoreKeys("\u0D0B", "7")), + // U+0D46: "െ" MALAYALAM VOWEL SIGN E + // U+0D0E: "എ" MALAYALAM LETTER E + // U+0D10: "ഐ" MALAYALAM LETTER AI + // U+0D48: "ൈ" MALAYALAM VOWEL SIGN AI + key("\u0D46", joinMoreKeys("\u0D0E", "\u0D10", "\u0D48", "8")), + // U+0D47: "േ" MALAYALAM VOWEL SIGN EE + // U+0D0F: "ഏ" MALAYALAM LETTER EE + key("\u0D47", joinMoreKeys("\u0D0F", "9")), + // U+0D4A: "ൊ" MALAYALAM VOWEL SIGN O + // U+0D12: "ഒ" MALAYALAM LETTER O + key("\u0D4A", joinMoreKeys("\u0D12", "0")), + // U+0D4B: "ോ" MALAYALAM VOWEL SIGN OO + // U+0D13: "ഓ" MALAYALAM LETTER OO + // U+0D14: "ഔ" MALAYALAM LETTER AU + // U+0D57: "ൗ" MALAYALAM AU LENGTH MARK + key("\u0D4B", joinMoreKeys("\u0D13", "\u0D14", "\u0D57"))) + .setKeysOfRow(2, + // U+0D15: "ക" MALAYALAM LETTER KA + // U+0D16: "ഖ" MALAYALAM LETTER KHA + key("\u0D15", moreKey("\u0D16")), + // U+0D17: "ഗ" MALAYALAM LETTER GA + // U+0D18: "ഘ" MALAYALAM LETTER GHA + key("\u0D17", moreKey("\u0D18")), + // U+0D19: "ങ" MALAYALAM LETTER NGA + // U+0D1E: "ഞ" MALAYALAM LETTER NYA + key("\u0D19", moreKey("\u0D1E")), + // U+0D1A: "ച" MALAYALAM LETTER CA + // U+0D1B: "ഛ" MALAYALAM LETTER CHA + key("\u0D1A", moreKey("\u0D1B")), + // U+0D1C: "ജ" MALAYALAM LETTER JA + // U+0D1D: "ഝ" MALAYALAM LETTER JHA + key("\u0D1C", moreKey("\u0D1D")), + // U+0D1F: "ട" MALAYALAM LETTER TTA + // U+0D20: "ഠ" MALAYALAM LETTER TTHA + key("\u0D1F", moreKey("\u0D20")), + // U+0D21: "ഡ" MALAYALAM LETTER DDA + // U+0D22: "ഢ" MALAYALAM LETTER DDHA + key("\u0D21", moreKey("\u0D22")), + // U+0D23: "ണ" MALAYALAM LETTER NNA + // U+0D7A: "ൺ" MALAYALAM LETTER CHILLU NN + key("\u0D23", moreKey("\u0D7A")), + // U+0D24: "ത" MALAYALAM LETTER TA + // U+0D25: "ഥ" MALAYALAM LETTER THA + key("\u0D24", moreKey("\u0D25")), + // U+0D26: "ദ" MALAYALAM LETTER DA + // U+0D27: "ധ" MALAYALAM LETTER DHA + key("\u0D26", moreKey("\u0D27")), + // U+0D28: "ഗന" MALAYALAM LETTER NA + // U+0D7B: "ൻ" MALAYALAM LETTER CHILLU N + key("\u0D28", moreKey("\u0D7B"))) + .setKeysOfRow(3, + // U+0D2A: "പ" MALAYALAM LETTER PA + // U+0D2B: "ഫ" MALAYALAM LETTER PHA + key("\u0D2A", moreKey("\u0D2B")), + // U+0D2C: "ബ" MALAYALAM LETTER BA + // U+0D2D: "ഭ" MALAYALAM LETTER BHA + key("\u0D2C", moreKey("\u0D2D")), + // U+0D2E: "മ" MALAYALAM LETTER MA + // U+0D02: "ം" MALAYALAM SIGN ANUSVARA + key("\u0D2E", moreKey("\u0D02")), + // U+0D2F: "യ" MALAYALAM LETTER YA + // U+0D4D/U+0D2F: "്യ" MALAYALAM SIGN VIRAMA/MALAYALAM LETTER YA + key("\u0D2F", moreKey("\u0D4D\u0D2F")), + // U+0D30: "ര" MALAYALAM LETTER RA + // U+0D4D/U+0D30: "്ര" MALAYALAM SIGN VIRAMA/MALAYALAM LETTER RA + // U+0D7C: "ർ" MALAYALAM LETTER CHILLU RR + // U+0D31: "റ" MALAYALAM LETTER RRA + key("\u0D30", joinMoreKeys("\u0D4D\u0D30", "\u0D7C", "\u0D31")), + // U+0D32: "ല" MALAYALAM LETTER LA + // U+0D7D: "ൽ" MALAYALAM LETTER CHILLU L + key("\u0D32", moreKey("\u0D7D")), + // U+0D35: "വ" MALAYALAM LETTER VA + // U+0D4D/U+0D35: "്വ" MALAYALAM SIGN VIRAMA/MALAYALAM LETTER VA + key("\u0D35", moreKey("\u0D4D\u0D35")), + // U+0D36: "ശ" MALAYALAM LETTER SHA + // U+0D37: "ഷ" MALAYALAM LETTER SSA + // U+0D38: "സ" MALAYALAM LETTER SA + key("\u0D36", joinMoreKeys("\u0D37", "\u0D38")), + // U+0D39: "ഹ" MALAYALAM LETTER HA + // U+0D03: "ഃ" MALAYALAM SIGN VISARGA + key("\u0D39", moreKey("\u0D03")), + // U+0D33: "ള" MALAYALAM LETTER LLA + // U+0D7E: "ൾ" MALAYALAM LETTER CHILLU LL + // U+0D34: "ഴ" MALAYALAM LETTER LLLA + key("\u0D33", joinMoreKeys("\u0D7E", "\u0D34"))) + .build(); +} diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMalayalamIN.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMalayalamIN.java new file mode 100644 index 000000000..f937de89a --- /dev/null +++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsMalayalamIN.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.inputmethod.keyboard.layout.tests; + +import android.test.suitebuilder.annotation.SmallTest; + +import com.android.inputmethod.keyboard.layout.LayoutBase; +import com.android.inputmethod.keyboard.layout.Malayalam; +import com.android.inputmethod.keyboard.layout.Malayalam.MalayalamCustomizer; + +import java.util.Locale; + +/** + * ta_IN: Malayalam (India)/malayalam + */ +@SmallTest +public final class TestsMalayalamIN extends LayoutTestsBase { + private static final Locale LOCALE = new Locale("ml", "IN"); + private static final LayoutBase LAYOUT = new Malayalam(new MalayalamCustomizer(LOCALE)); + + @Override + LayoutBase getLayout() { return LAYOUT; } +} diff --git a/tools/make-keyboard-text/res/values-ml-rIN/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-ml-rIN/donottranslate-more-keys.xml new file mode 100644 index 000000000..7a2aeed36 --- /dev/null +++ b/tools/make-keyboard-text/res/values-ml-rIN/donottranslate-more-keys.xml @@ -0,0 +1,26 @@ + + + + + + + +