diff --git a/java/res/xml-sw600dp/rows_tamil.xml b/java/res/xml-sw600dp/rows_tamil.xml new file mode 100644 index 000000000..785e751c8 --- /dev/null +++ b/java/res/xml-sw600dp/rows_tamil.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + diff --git a/java/res/xml/kbd_tamil.xml b/java/res/xml/kbd_tamil.xml new file mode 100644 index 000000000..617e4de47 --- /dev/null +++ b/java/res/xml/kbd_tamil.xml @@ -0,0 +1,26 @@ + + + + + + diff --git a/java/res/xml/key_styles_currency.xml b/java/res/xml/key_styles_currency.xml index f576d0465..900c9bb7a 100644 --- a/java/res/xml/key_styles_currency.xml +++ b/java/res/xml/key_styles_currency.xml @@ -18,15 +18,10 @@ */ --> - + - - + + - - + + @@ -76,26 +68,54 @@ sl: Slovenia (sl_SL) sv: Sweden (sv_SV) tr: Trukey (tr_TR) --> - - + + - - + + + + + + + + + + + + + - + - - - - - - - - - - - + - + diff --git a/java/res/xml/keyboard_layout_set_tamil.xml b/java/res/xml/keyboard_layout_set_tamil.xml new file mode 100644 index 000000000..5c0491505 --- /dev/null +++ b/java/res/xml/keyboard_layout_set_tamil.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + diff --git a/java/res/xml/method.xml b/java/res/xml/method.xml index 67be24256..7a6640bcc 100644 --- a/java/res/xml/method.xml +++ b/java/res/xml/method.xml @@ -89,6 +89,7 @@ (sr-Latn: Serbian/qwerty) # not yet implemented. sv: Swedish/nordic sw: Swahili/qwerty + (ta: Tamil/tamil) # This is a preliminary keyboard layout. th: Thai/thai tl: Tagalog/spanish tr: Turkish/qwerty @@ -666,6 +667,16 @@ android:imeSubtypeExtraValue="KeyboardLayoutSet=qwerty,AsciiCapable,EmojiCapable" android:isAsciiCapable="true" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/res/xml/rowkeys_tamil2.xml b/java/res/xml/rowkeys_tamil2.xml new file mode 100644 index 000000000..894825cb4 --- /dev/null +++ b/java/res/xml/rowkeys_tamil2.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/res/xml/rowkeys_tamil3.xml b/java/res/xml/rowkeys_tamil3.xml new file mode 100644 index 000000000..5386e61cf --- /dev/null +++ b/java/res/xml/rowkeys_tamil3.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/java/res/xml/rows_tamil.xml b/java/res/xml/rows_tamil.xml new file mode 100644 index 000000000..3aa2c8dc4 --- /dev/null +++ b/java/res/xml/rows_tamil.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 be3c40471..8b8a9dd2a 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:24 */ "keylabel_to_alpha", + /* 5:25 */ "keylabel_to_alpha", /* 6:23 */ "morekeys_c", /* 7:23 */ "double_quotes", /* 8:22 */ "morekeys_n", @@ -97,7 +97,7 @@ public final class KeyboardTextsTable { /* 11:14 */ "morekeys_y", /* 12:13 */ "morekeys_d", /* 13:12 */ "morekeys_z", - /* 14:11 */ "keyspec_currency", + /* 14:12 */ "keyspec_currency", /* 15:10 */ "morekeys_t", /* 16:10 */ "morekeys_l", /* 17: 9 */ "morekeys_g", @@ -3378,6 +3378,23 @@ public final class KeyboardTextsTable { /* morekeys_g */ "g\'", }; + /* Locale ta_IN: Tamil (India) */ + private static final String[] TEXTS_ta_IN = { + /* morekeys_a ~ */ + null, null, null, null, null, + /* ~ morekeys_i */ + // Label for "switch to alphabetic" key. + // U+0BA4: "த" TAMIL LETTER TA + // U+0BAE/U+0BBF: "மி" TAMIL LETTER MA/TAMIL VOWEL SIGN I + // 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 */ + // U+0BF9: "௹" TAMIL RUPEE SIGN + /* keyspec_currency */ "\u0BF9", + }; + /* Locale th: Thai */ private static final String[] TEXTS_th = { /* morekeys_a ~ */ @@ -3871,6 +3888,7 @@ 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 */ "tl" , TEXTS_tl, /* 7/ 9 Tagalog */ "tr" , TEXTS_tr, /* 7/ 18 Turkish */ diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetSubtypesCountTests.java index 6ee6adbba..67b87200f 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 = 73; + private static final int NUMBER_OF_SUBTYPES = 74; 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/Tamil.java b/tests/src/com/android/inputmethod/keyboard/layout/Tamil.java new file mode 100644 index 000000000..792e7ea23 --- /dev/null +++ b/tests/src/com/android/inputmethod/keyboard/layout/Tamil.java @@ -0,0 +1,144 @@ +/* + * 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 Tamil keyboard. + */ +public final class Tamil extends LayoutBase { + private static final String LAYOUT_NAME = "tamil"; + + public Tamil(final LayoutCustomizer customizer) { + super(customizer, Symbols.class, SymbolsShifted.class); + } + + @Override + public String getName() { return LAYOUT_NAME; } + + public static class TamilCustomizer extends LayoutCustomizer { + public TamilCustomizer(final Locale locale) { super(locale); } + + @Override + public ExpectedKey getAlphabetKey() { return TAMIL_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; + } + + // U+0BA4: "த" TAMIL LETTER TA + // U+0BAE/U+0BBF: "மி" TAMIL LETTER MA/TAMIL VOWEL SIGN I + // U+0BB4/U+0BCD: "ழ்" TAMIL LETTER LLLA/TAMIL SIGN VIRAMA + private static final ExpectedKey TAMIL_ALPHABET_KEY = key( + "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD", Constants.CODE_SWITCH_ALPHA_SYMBOL); + + // U+0BF9: "௹" TAMIL RUPEE SIGN + private static final ExpectedKey CURRENCY_RUPEE = key("\u0BF9", + 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+0B94: "ஔ" TAMIL LETTER AU + key("\u0B94", moreKey("1")), + // U+0B90: "ஐ" TAMIL LETTER AI + key("\u0B90", moreKey("2")), + // U+0B86: "ஆ" TAMIL LETTER AA + key("\u0B86", moreKey("3")), + // U+0B88: "ஈ" TAMIL LETTER II + key("\u0B88", moreKey("4")), + // U+0B8A: "ஊ" TAMIL LETTER UU + key("\u0B8A", moreKey("5")), + // U+0BAE: "ம" TAMIL LETTER MA + key("\u0BAE", moreKey("6")), + // U+0BA9: "ன" TAMIL LETTER NNNA + key("\u0BA9", moreKey("7")), + // U+0BA8: "ந" TAMIL LETTER NA + key("\u0BA8", moreKey("8")), + // U+0B99: "ங" TAMIL LETTER NGA + key("\u0B99", moreKey("9")), + // U+0BA3: "ண" TAMIL LETTER NNA + key("\u0BA3", moreKey("0")), + // U+0B9E: "ஞ" TAMIL LETTER NYA + "\u0B9E") + .setKeysOfRow(2, + // U+0B93: "ஓ" TAMIL LETTER OO + // U+0BD0: "ௐ" TAMIL OM + key("\u0B93", moreKey("\u0BD0")), + // U+0B8F: "ஏ" TAMIL LETTER EE + "\u0B8F", + // U+0B85: "அ" TAMIL LETTER A + // U+0B83: "ஃ" TAMIL SIGN VISARGA + key("\u0B85", moreKey("\u0B83")), + // U+0B87: "இ" TAMIL LETTER I + // U+0B89: "உ" TAMIL LETTER U + // U+0BB1: "ற" TAMIL LETTER RRA + // U+0BAA: "ப" TAMIL LETTER PA + "\u0B87", "\u0B89", "\u0BB1", "\u0BAA", + // U+0B95: "க" TAMIL LETTER KA + // U+0BB9: "ஹ" TAMIL LETTER HA + // U+0B95/U+0BCD/U+0BB7: + // "க்ஷ" TAMIL LETTER KA/TAMIL SIGN VIRAMA/TAMIL LETTER SSA + key("\u0B95", joinMoreKeys("\u0BB9", "\u0B95\u0BCD\u0BB7")), + // U+0BA4: "த" TAMIL LETTER TA + "\u0BA4", + // U+0B9A: "ச" TAMIL LETTER CA + // U+0BB8: "ஸ" TAMIL LETTER SA + // U+0BB6/U+0BCD/U+0BB0/U+0BC0: + // "ஶ்ரீ" TAMIL LETTER SHA/TAMIL SIGN VIRAMA/TAMIL LETTER RA + // /TAMIL VOWEL SIGN II + key("\u0B9A", joinMoreKeys("\u0BB8", "\u0BB6\u0BCD\u0BB0\u0BC0")), + // U+0B9F: "ட" TAMIL LETTER TTA + "\u0B9F") + .setKeysOfRow(3, + // U+0B92: "ஒ" TAMIL LETTER O + // U+0B8E: "எ" TAMIL LETTER E + // U+0BCD: "்" TAMIL SIGN VIRAMA + // U+0BB0: "ர" TAMIL LETTER RA + // U+0BB5: "வ" TAMIL LETTER VA + // U+0BB4: "ழ TAMIL LETTER LLLA + // U+0BB2: "ல" TAMIL LETTER LA + // U+0BB3: "ள" TAMIL LETTER LLA + // U+0BAF: "ய" TAMIL LETTER YA + "\u0B92", "\u0B8E", "\u0BCD", "\u0BB0", "\u0BB5", "\u0BB4", "\u0BB2", "\u0BB3", + "\u0BAF", + // U+0BB7: "ஷ" TAMIL LETTER SSA + // U+0B9C: "ஜ" TAMIL LETTER JA + key("\u0BB7", moreKey("\u0B9C"))) + .build(); +} diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsTamilIN.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsTamilIN.java new file mode 100644 index 000000000..5b3649d2b --- /dev/null +++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/TestsTamilIN.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.Tamil; +import com.android.inputmethod.keyboard.layout.Tamil.TamilCustomizer; + +import java.util.Locale; + +/** + * ta_IN: Tamil (India)/tamil + */ +@SmallTest +public final class TestsTamilIN extends LayoutTestsBase { + private static final Locale LOCALE = new Locale("ta", "IN"); + private static final LayoutBase LAYOUT = new Tamil(new TamilCustomizer(LOCALE)); + + @Override + LayoutBase getLayout() { return LAYOUT; } +} diff --git a/tools/make-keyboard-text/res/values-ta-rIN/donottranslate-more-keys.xml b/tools/make-keyboard-text/res/values-ta-rIN/donottranslate-more-keys.xml new file mode 100644 index 000000000..547c8e132 --- /dev/null +++ b/tools/make-keyboard-text/res/values-ta-rIN/donottranslate-more-keys.xml @@ -0,0 +1,28 @@ + + + + + தமிழ் + + +