diff --git a/java/res/xml-sw600dp/key_shortcut.xml b/java/res/xml-sw600dp/key_shortcut.xml index 2114c67bd..f8cbdf6b6 100644 --- a/java/res/xml-sw600dp/key_shortcut.xml +++ b/java/res/xml-sw600dp/key_shortcut.xml @@ -29,7 +29,7 @@ + latin:moreKeys="!text/more_keys_for_smiley" /> + latin:keyOutputText="!text/keylabel_for_popular_domain" + latin:moreKeys="!text/more_keys_for_popular_domain" /> diff --git a/java/res/xml-sw600dp/keys_apostrophe_dash.xml b/java/res/xml-sw600dp/keys_apostrophe_dash.xml index faaae50c9..badc6e516 100644 --- a/java/res/xml-sw600dp/keys_apostrophe_dash.xml +++ b/java/res/xml-sw600dp/keys_apostrophe_dash.xml @@ -39,9 +39,9 @@ @@ -54,9 +54,9 @@ diff --git a/java/res/xml-sw600dp/keys_comma_period.xml b/java/res/xml-sw600dp/keys_comma_period.xml index 4a83cc817..752f75b5f 100644 --- a/java/res/xml-sw600dp/keys_comma_period.xml +++ b/java/res/xml-sw600dp/keys_comma_period.xml @@ -32,14 +32,14 @@ diff --git a/java/res/xml-sw600dp/rowkeys_symbols2.xml b/java/res/xml-sw600dp/rowkeys_symbols2.xml index fd774168f..6fe86240c 100644 --- a/java/res/xml-sw600dp/rowkeys_symbols2.xml +++ b/java/res/xml-sw600dp/rowkeys_symbols2.xml @@ -26,13 +26,13 @@ + latin:keyLabel="!text/keylabel_for_symbols_percent" + latin:moreKeys="!text/more_keys_for_symbols_percent" /> + latin:moreKeys="!text/more_keys_for_star" /> + latin:moreKeys="!text/more_keys_for_plus" /> diff --git a/java/res/xml-sw600dp/rowkeys_symbols3.xml b/java/res/xml-sw600dp/rowkeys_symbols3.xml index 536ac05a2..4eb9618cf 100644 --- a/java/res/xml-sw600dp/rowkeys_symbols3.xml +++ b/java/res/xml-sw600dp/rowkeys_symbols3.xml @@ -41,11 +41,11 @@ + latin:keyLabel="!text/keylabel_for_symbols_semicolon" + latin:moreKeys="!text/more_keys_for_symbols_semicolon" /> + latin:keyLabel="!text/keylabel_for_comma" + latin:moreKeys="!text/more_keys_for_comma" /> @@ -53,6 +53,6 @@ latin:keyLabel="!" latin:moreKeys="¡" /> + latin:keyLabel="!text/keylabel_for_symbols_question" + latin:moreKeys="!text/more_keys_for_symbols_question" /> diff --git a/java/res/xml-sw600dp/rowkeys_symbols_shift1.xml b/java/res/xml-sw600dp/rowkeys_symbols_shift1.xml index 914a4499b..3549fdda4 100644 --- a/java/res/xml-sw600dp/rowkeys_symbols_shift1.xml +++ b/java/res/xml-sw600dp/rowkeys_symbols_shift1.xml @@ -30,7 +30,7 @@ + latin:moreKeys="!text/more_keys_for_bullet" /> diff --git a/java/res/xml-sw600dp/rows_number_normal.xml b/java/res/xml-sw600dp/rows_number_normal.xml index 00fda2899..3fda2aa13 100644 --- a/java/res/xml-sw600dp/rows_number_normal.xml +++ b/java/res/xml-sw600dp/rows_number_normal.xml @@ -70,7 +70,7 @@ diff --git a/java/res/xml-sw600dp/rows_symbols4.xml b/java/res/xml-sw600dp/rows_symbols4.xml index afa2652ea..baa090c24 100644 --- a/java/res/xml-sw600dp/rows_symbols4.xml +++ b/java/res/xml-sw600dp/rows_symbols4.xml @@ -37,7 +37,7 @@ latin:keyWidth="39.750%p" /> + latin:moreKeys="!text/more_keys_for_tablet_double_quote" /> + latin:moreKeys="!text/more_keys_for_smiley" /> @@ -121,7 +121,7 @@ @@ -129,35 +129,35 @@ + latin:keyOutputText="!text/keylabel_for_popular_domain" + latin:moreKeys="!text/more_keys_for_popular_domain" /> diff --git a/java/res/xml-sw768dp/keys_apostrophe_dash.xml b/java/res/xml-sw768dp/keys_apostrophe_dash.xml index faaae50c9..badc6e516 100644 --- a/java/res/xml-sw768dp/keys_apostrophe_dash.xml +++ b/java/res/xml-sw768dp/keys_apostrophe_dash.xml @@ -39,9 +39,9 @@ @@ -54,9 +54,9 @@ diff --git a/java/res/xml-sw768dp/rows_number_normal.xml b/java/res/xml-sw768dp/rows_number_normal.xml index f868cbb8b..0d75a37d2 100644 --- a/java/res/xml-sw768dp/rows_number_normal.xml +++ b/java/res/xml-sw768dp/rows_number_normal.xml @@ -72,7 +72,7 @@ diff --git a/java/res/xml-sw768dp/rows_symbols4.xml b/java/res/xml-sw768dp/rows_symbols4.xml index dd1647b95..ecb1259d1 100644 --- a/java/res/xml-sw768dp/rows_symbols4.xml +++ b/java/res/xml-sw768dp/rows_symbols4.xml @@ -37,7 +37,7 @@ latin:keyWidth="37.500%p" /> + latin:moreKeys="!text/more_keys_for_tablet_double_quote" /> diff --git a/java/res/xml/key_azerty_quote.xml b/java/res/xml/key_azerty_quote.xml index b8c51d30f..65789ea69 100644 --- a/java/res/xml/key_azerty_quote.xml +++ b/java/res/xml/key_azerty_quote.xml @@ -31,7 +31,7 @@ + latin:moreKeys="!text/more_keys_for_single_quote" /> diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml index 35abb4fba..4341b7903 100644 --- a/java/res/xml/key_styles_common.xml +++ b/java/res/xml/key_styles_common.xml @@ -35,7 +35,7 @@ @@ -98,7 +98,7 @@ latin:keyLabel=":-)" latin:keyOutputText=":-) " latin:keyLabelFlags="hasPopupHint" - latin:moreKeys="!label/more_keys_for_smiley" + latin:moreKeys="!text/more_keys_for_smiley" latin:backgroundType="functional" /> @@ -157,7 +157,7 @@ latin:styleName="toSymbolKeyStyle" latin:code="!code/key_switch_alpha_symbol" latin:keyIcon="!icon/shortcut_for_label" - latin:keyLabel="!label/label_to_symbol_with_microphone_key" + latin:keyLabel="!text/label_to_symbol_with_microphone_key" latin:keyLabelFlags="withIconRight" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> @@ -166,7 +166,7 @@ @@ -174,27 +174,27 @@ diff --git a/java/res/xml/key_styles_currency.xml b/java/res/xml/key_styles_currency.xml index 6057d5bd7..d5c6a87b9 100644 --- a/java/res/xml/key_styles_currency.xml +++ b/java/res/xml/key_styles_currency.xml @@ -86,7 +86,7 @@ + latin:moreKeys="!text/more_keys_for_currency_general" /> @@ -112,7 +112,7 @@ + latin:moreKeys="!text/more_keys_for_currency_general" /> @@ -138,7 +138,7 @@ + latin:moreKeys="!text/more_keys_for_currency_pound" /> diff --git a/java/res/xml/key_styles_currency_dollar.xml b/java/res/xml/key_styles_currency_dollar.xml index 704970a56..674a3966d 100644 --- a/java/res/xml/key_styles_currency_dollar.xml +++ b/java/res/xml/key_styles_currency_dollar.xml @@ -26,7 +26,7 @@ + latin:moreKeys="!text/more_keys_for_currency_dollar" /> diff --git a/java/res/xml/key_styles_enter.xml b/java/res/xml/key_styles_enter.xml index 88777dca3..be5be1bf9 100644 --- a/java/res/xml/key_styles_enter.xml +++ b/java/res/xml/key_styles_enter.xml @@ -30,7 +30,7 @@ + latin:moreKeys="!text/action_previous_as_more_key" /> + latin:moreKeys="!text/action_next_as_more_key" /> + latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/action_previous_as_more_key,!text/action_next_as_more_key" /> + latin:moreKeys="!text/action_next_as_more_key" /> + latin:moreKeys="!text/action_previous_as_more_key" /> @@ -119,7 +119,7 @@ > + latin:moreKeys="!text/more_keys_for_less_than" /> + latin:moreKeys="!text/more_keys_for_greater_than" /> diff --git a/java/res/xml/keys_parentheses.xml b/java/res/xml/keys_parentheses.xml index 17d72859c..25e89c930 100644 --- a/java/res/xml/keys_parentheses.xml +++ b/java/res/xml/keys_parentheses.xml @@ -24,9 +24,9 @@ + latin:moreKeys="!text/more_keys_for_left_parenthesis" /> + latin:moreKeys="!text/more_keys_for_right_parenthesis" /> diff --git a/java/res/xml/row_qwerty4.xml b/java/res/xml/row_qwerty4.xml index c08518079..343e3eec9 100644 --- a/java/res/xml/row_qwerty4.xml +++ b/java/res/xml/row_qwerty4.xml @@ -51,9 +51,9 @@ diff --git a/java/res/xml/rowkeys_azerty1.xml b/java/res/xml/rowkeys_azerty1.xml index 50a0162de..42b27463f 100644 --- a/java/res/xml/rowkeys_azerty1.xml +++ b/java/res/xml/rowkeys_azerty1.xml @@ -25,47 +25,47 @@ latin:keyLabel="a" latin:keyHintLabel="1" latin:additionalMoreKeys="1" - latin:moreKeys="!label/more_keys_for_a" /> + latin:moreKeys="!text/more_keys_for_a" /> + latin:moreKeys="!text/more_keys_for_z" /> + latin:moreKeys="!text/more_keys_for_e" /> + latin:moreKeys="!text/more_keys_for_r" /> + latin:moreKeys="!text/more_keys_for_t" /> + latin:moreKeys="!text/more_keys_for_y" /> + latin:moreKeys="!text/more_keys_for_u" /> + latin:moreKeys="!text/more_keys_for_i" /> + latin:moreKeys="!text/more_keys_for_o" /> + latin:moreKeys="!text/more_keys_for_s" /> + latin:moreKeys="!text/more_keys_for_d" /> + latin:moreKeys="!text/more_keys_for_g" /> + latin:moreKeys="!text/more_keys_for_h" /> + latin:moreKeys="!text/more_keys_for_j" /> + latin:moreKeys="!text/more_keys_for_k" /> + latin:moreKeys="!text/more_keys_for_l" /> diff --git a/java/res/xml/rowkeys_azerty3.xml b/java/res/xml/rowkeys_azerty3.xml index 35e9b195f..9f4c608f8 100644 --- a/java/res/xml/rowkeys_azerty3.xml +++ b/java/res/xml/rowkeys_azerty3.xml @@ -23,20 +23,20 @@ > + latin:moreKeys="!text/more_keys_for_w" /> + latin:moreKeys="!text/more_keys_for_c" /> + latin:moreKeys="!text/more_keys_for_v" /> + latin:moreKeys="!text/more_keys_for_n" /> diff --git a/java/res/xml/rowkeys_east_slavic1.xml b/java/res/xml/rowkeys_east_slavic1.xml index dd83c0250..00cb6a973 100644 --- a/java/res/xml/rowkeys_east_slavic1.xml +++ b/java/res/xml/rowkeys_east_slavic1.xml @@ -36,7 +36,7 @@ latin:keyLabel="у" latin:keyHintLabel="3" latin:additionalMoreKeys="3" - latin:moreKeys="!label/more_keys_for_cyrillic_u" /> + latin:moreKeys="!text/more_keys_for_cyrillic_u" /> + latin:moreKeys="!text/more_keys_for_cyrillic_ye" /> + latin:moreKeys="!text/more_keys_for_cyrillic_en" /> @@ -76,5 +76,5 @@ + latin:moreKeys="!text/more_keys_for_cyrillic_ha" /> diff --git a/java/res/xml/rowkeys_east_slavic2.xml b/java/res/xml/rowkeys_east_slavic2.xml index 75d7d939d..c635af2d9 100644 --- a/java/res/xml/rowkeys_east_slavic2.xml +++ b/java/res/xml/rowkeys_east_slavic2.xml @@ -25,8 +25,8 @@ + latin:keyLabel="!text/keylabel_for_east_slavic_row2_1" + latin:moreKeys="!text/more_keys_for_east_slavic_row2_1" /> @@ -42,7 +42,7 @@ + latin:moreKeys="!text/more_keys_for_cyrillic_o" /> diff --git a/java/res/xml/rowkeys_east_slavic3.xml b/java/res/xml/rowkeys_east_slavic3.xml index a05e92d44..c3a171b49 100644 --- a/java/res/xml/rowkeys_east_slavic3.xml +++ b/java/res/xml/rowkeys_east_slavic3.xml @@ -34,14 +34,14 @@ + latin:keyLabel="!text/keylabel_for_east_slavic_row3_5" /> + latin:moreKeys="!text/more_keys_for_cyrillic_soft_sign" /> diff --git a/java/res/xml/rowkeys_nordic1.xml b/java/res/xml/rowkeys_nordic1.xml index ff29369d7..72ac86b2e 100644 --- a/java/res/xml/rowkeys_nordic1.xml +++ b/java/res/xml/rowkeys_nordic1.xml @@ -24,5 +24,5 @@ + latin:keyLabel="!text/keylabel_for_nordic_row1_11" /> diff --git a/java/res/xml/rowkeys_nordic2.xml b/java/res/xml/rowkeys_nordic2.xml index 52bb2f18f..836214abf 100644 --- a/java/res/xml/rowkeys_nordic2.xml +++ b/java/res/xml/rowkeys_nordic2.xml @@ -24,9 +24,9 @@ + latin:keyLabel="!text/keylabel_for_nordic_row2_10" + latin:moreKeys="!text/more_keys_for_nordic_row2_10" /> + latin:keyLabel="!text/keylabel_for_nordic_row2_11" + latin:moreKeys="!text/more_keys_for_nordic_row2_11" /> diff --git a/java/res/xml/rowkeys_qwerty1.xml b/java/res/xml/rowkeys_qwerty1.xml index 8fb60db74..84d613460 100644 --- a/java/res/xml/rowkeys_qwerty1.xml +++ b/java/res/xml/rowkeys_qwerty1.xml @@ -29,42 +29,42 @@ latin:keyLabel="w" latin:keyHintLabel="2" latin:additionalMoreKeys="2" - latin:moreKeys="!label/more_keys_for_w" /> + latin:moreKeys="!text/more_keys_for_w" /> + latin:moreKeys="!text/more_keys_for_e" /> + latin:moreKeys="!text/more_keys_for_r" /> + latin:moreKeys="!text/more_keys_for_t" /> + latin:moreKeys="!text/more_keys_for_y" /> + latin:moreKeys="!text/more_keys_for_u" /> + latin:moreKeys="!text/more_keys_for_i" /> + latin:moreKeys="!text/more_keys_for_o" /> + latin:moreKeys="!text/more_keys_for_a" /> + latin:moreKeys="!text/more_keys_for_s" /> + latin:moreKeys="!text/more_keys_for_d" /> + latin:moreKeys="!text/more_keys_for_g" /> + latin:moreKeys="!text/more_keys_for_h" /> + latin:moreKeys="!text/more_keys_for_j" /> + latin:moreKeys="!text/more_keys_for_k" /> + latin:moreKeys="!text/more_keys_for_l" /> diff --git a/java/res/xml/rowkeys_qwerty3.xml b/java/res/xml/rowkeys_qwerty3.xml index afe43f6e4..a74aeb842 100644 --- a/java/res/xml/rowkeys_qwerty3.xml +++ b/java/res/xml/rowkeys_qwerty3.xml @@ -23,20 +23,20 @@ > + latin:moreKeys="!text/more_keys_for_z" /> + latin:moreKeys="!text/more_keys_for_c" /> + latin:moreKeys="!text/more_keys_for_v" /> + latin:moreKeys="!text/more_keys_for_n" /> diff --git a/java/res/xml/rowkeys_qwertz1.xml b/java/res/xml/rowkeys_qwertz1.xml index 12788968a..d87f03ddc 100644 --- a/java/res/xml/rowkeys_qwertz1.xml +++ b/java/res/xml/rowkeys_qwertz1.xml @@ -29,42 +29,42 @@ latin:keyLabel="w" latin:keyHintLabel="2" latin:additionalMoreKeys="2" - latin:moreKeys="!label/more_keys_for_w" /> + latin:moreKeys="!text/more_keys_for_w" /> + latin:moreKeys="!text/more_keys_for_e" /> + latin:moreKeys="!text/more_keys_for_r" /> + latin:moreKeys="!text/more_keys_for_t" /> + latin:moreKeys="!text/more_keys_for_z" /> + latin:moreKeys="!text/more_keys_for_u" /> + latin:moreKeys="!text/more_keys_for_i" /> + latin:moreKeys="!text/more_keys_for_o" /> + latin:moreKeys="!text/more_keys_for_y" /> + latin:moreKeys="!text/more_keys_for_c" /> + latin:moreKeys="!text/more_keys_for_v" /> + latin:moreKeys="!text/more_keys_for_n" /> diff --git a/java/res/xml/rowkeys_south_slavic1.xml b/java/res/xml/rowkeys_south_slavic1.xml index 7c9a3bc92..6117d46f1 100644 --- a/java/res/xml/rowkeys_south_slavic1.xml +++ b/java/res/xml/rowkeys_south_slavic1.xml @@ -36,7 +36,7 @@ latin:keyLabel="е" latin:keyHintLabel="3" latin:additionalMoreKeys="3" - latin:moreKeys="!label/more_keys_for_cyrillic_ie" /> + latin:moreKeys="!text/more_keys_for_cyrillic_ie" /> @@ -61,7 +61,7 @@ latin:keyLabel="и" latin:keyHintLabel="8" latin:additionalMoreKeys="8" - latin:moreKeys="!label/more_keys_for_cyrillic_i" /> + latin:moreKeys="!text/more_keys_for_cyrillic_i" /> + latin:keyLabel="!text/keylabel_for_south_slavic_row2_11" /> diff --git a/java/res/xml/rowkeys_south_slavic3.xml b/java/res/xml/rowkeys_south_slavic3.xml index d668ddf39..b01550911 100644 --- a/java/res/xml/rowkeys_south_slavic3.xml +++ b/java/res/xml/rowkeys_south_slavic3.xml @@ -22,7 +22,7 @@ xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" > + latin:keyLabel="!text/keylabel_for_south_slavic_row3_1" /> @@ -42,7 +42,7 @@ + latin:keyLabel="!text/keylabel_for_south_slavic_row3_8" /> diff --git a/java/res/xml/rowkeys_symbols1.xml b/java/res/xml/rowkeys_symbols1.xml index f9f8bb16c..6e2f92dd9 100644 --- a/java/res/xml/rowkeys_symbols1.xml +++ b/java/res/xml/rowkeys_symbols1.xml @@ -22,43 +22,43 @@ xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" > + latin:keyLabel="!text/keylabel_for_symbols_1" + latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_1" + latin:moreKeys="!text/more_keys_for_symbols_1" /> + latin:keyLabel="!text/keylabel_for_symbols_2" + latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_2" + latin:moreKeys="!text/more_keys_for_symbols_2" /> + latin:keyLabel="!text/keylabel_for_symbols_3" + latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_3" + latin:moreKeys="!text/more_keys_for_symbols_3" /> + latin:keyLabel="!text/keylabel_for_symbols_4" + latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_4" + latin:moreKeys="!text/more_keys_for_symbols_4" /> + latin:keyLabel="!text/keylabel_for_symbols_5" + latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_5" + latin:moreKeys="!text/more_keys_for_symbols_5" /> + latin:keyLabel="!text/keylabel_for_symbols_6" + latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_6" + latin:moreKeys="!text/more_keys_for_symbols_6" /> + latin:keyLabel="!text/keylabel_for_symbols_7" + latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_7" + latin:moreKeys="!text/more_keys_for_symbols_7" /> + latin:keyLabel="!text/keylabel_for_symbols_8" + latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_8" + latin:moreKeys="!text/more_keys_for_symbols_8" /> + latin:keyLabel="!text/keylabel_for_symbols_9" + latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_9" + latin:moreKeys="!text/more_keys_for_symbols_9" /> + latin:keyLabel="!text/keylabel_for_symbols_0" + latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_0" + latin:moreKeys="!text/more_keys_for_symbols_0" /> diff --git a/java/res/xml/rowkeys_symbols2.xml b/java/res/xml/rowkeys_symbols2.xml index 47865a989..34b9aa2ee 100644 --- a/java/res/xml/rowkeys_symbols2.xml +++ b/java/res/xml/rowkeys_symbols2.xml @@ -28,13 +28,13 @@ + latin:keyLabel="!text/keylabel_for_symbols_percent" + latin:moreKeys="!text/more_keys_for_symbols_percent" /> + latin:moreKeys="!text/more_keys_for_star" /> + latin:moreKeys="!text/more_keys_for_plus" /> diff --git a/java/res/xml/rowkeys_symbols3.xml b/java/res/xml/rowkeys_symbols3.xml index 4cef6b255..294e94d31 100644 --- a/java/res/xml/rowkeys_symbols3.xml +++ b/java/res/xml/rowkeys_symbols3.xml @@ -31,20 +31,20 @@ latin:moreKeys="¡" /> + latin:moreKeys="!text/more_keys_for_double_quote" /> + latin:moreKeys="!text/more_keys_for_single_quote" /> + latin:keyLabel="!text/keylabel_for_symbols_semicolon" + latin:moreKeys="!text/more_keys_for_symbols_semicolon" /> + latin:keyLabel="!text/keylabel_for_symbols_question" + latin:moreKeys="!text/more_keys_for_symbols_question" /> + latin:moreKeys="!text/more_keys_for_bullet" /> diff --git a/java/res/xml/rows_number_normal.xml b/java/res/xml/rows_number_normal.xml index 7015bb2d6..28bd7a1d2 100644 --- a/java/res/xml/rows_number_normal.xml +++ b/java/res/xml/rows_number_normal.xml @@ -61,7 +61,7 @@ diff --git a/java/res/xml/rows_symbols4.xml b/java/res/xml/rows_symbols4.xml index de7e043e8..3ff884607 100644 --- a/java/res/xml/rows_symbols4.xml +++ b/java/res/xml/rows_symbols4.xml @@ -37,9 +37,9 @@ diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java index fca8f56c8..dcbdc2731 100644 --- a/java/src/com/android/inputmethod/keyboard/Keyboard.java +++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java @@ -30,7 +30,7 @@ import android.view.InflateException; import com.android.inputmethod.keyboard.internal.KeyStyles; import com.android.inputmethod.keyboard.internal.KeyboardCodesSet; import com.android.inputmethod.keyboard.internal.KeyboardIconsSet; -import com.android.inputmethod.keyboard.internal.KeyboardLabelsSet; +import com.android.inputmethod.keyboard.internal.KeyboardTextsSet; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.LocaleUtils.RunInLocale; import com.android.inputmethod.latin.R; @@ -236,8 +236,8 @@ public class Keyboard { public final ArrayList mAltCodeKeysWhileTyping = new ArrayList(); public final KeyboardIconsSet mIconsSet = new KeyboardIconsSet(); public final KeyboardCodesSet mCodesSet = new KeyboardCodesSet(); - public final KeyboardLabelsSet mLabelsSet = new KeyboardLabelsSet(); - public final KeyStyles mKeyStyles = new KeyStyles(mLabelsSet); + public final KeyboardTextsSet mTextsSet = new KeyboardTextsSet(); + public final KeyStyles mKeyStyles = new KeyStyles(mTextsSet); public KeyboardLayoutSet.KeysCache mKeysCache; @@ -776,11 +776,11 @@ public class Keyboard { params.mIconsSet.loadIcons(keyboardAttr); final String language = params.mId.mLocale.getLanguage(); params.mCodesSet.setLanguage(language); - params.mLabelsSet.setLanguage(language); + params.mTextsSet.setLanguage(language); final RunInLocale job = new RunInLocale() { @Override protected Void job(Resources res) { - params.mLabelsSet.loadStringResources(mContext); + params.mTextsSet.loadStringResources(mContext); return null; } }; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java index 97e360e0b..a44ddf182 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java @@ -30,8 +30,8 @@ import java.util.Arrays; * The specification is comma separated texts each of which represents one "more key". * The specification might have label or string resource reference in it. These references are * expanded before parsing comma. - * - Label reference should be a string representation of label (!label/label_name) - * - String resource reference should be a string representation of resource (!label/resource_name) + * - Label reference should be a string representation of label (!text/label_name) + * - String resource reference should be a string representation of resource (!text/resource_name) * Each "more key" specification is one of the following: * - Label optionally followed by keyOutputText or code (keyLabel|keyOutputText). * - Icon followed by keyOutputText or code (!icon/icon_name|!code/code_name) @@ -51,7 +51,7 @@ public class KeySpecParser { private static int COMMA = ','; private static final char ESCAPE_CHAR = '\\'; private static final char LABEL_END = '|'; - private static final String PREFIX_LABEL = "!label/"; + private static final String PREFIX_TEXT = "!text/"; private static final String PREFIX_ICON = "!icon/"; private static final String PREFIX_CODE = "!code/"; private static final String PREFIX_HEX = "0x"; @@ -334,7 +334,7 @@ public class KeySpecParser { } } - public static String resolveLabelReference(String rawText, KeyboardLabelsSet labelsSet) { + public static String resolveTextReference(String rawText, KeyboardTextsSet textsSet) { int level = 0; String text = rawText; StringBuilder sb; @@ -344,7 +344,7 @@ public class KeySpecParser { throw new RuntimeException("too many @string/resource indirection: " + text); } - final int prefixLen = PREFIX_LABEL.length(); + final int prefixLen = PREFIX_TEXT.length(); final int size = text.length(); if (size < prefixLen) { return text; @@ -353,14 +353,14 @@ public class KeySpecParser { sb = null; for (int pos = 0; pos < size; pos++) { final char c = text.charAt(pos); - if (text.regionMatches(true, pos, PREFIX_LABEL, 0, prefixLen) - && labelsSet != null) { + if (text.regionMatches(true, pos, PREFIX_TEXT, 0, prefixLen) + && textsSet != null) { if (sb == null) { sb = new StringBuilder(text.substring(0, pos)); } - final int end = searchLabelNameEnd(text, pos + prefixLen); + final int end = searchTextNameEnd(text, pos + prefixLen); final String name = text.substring(pos + prefixLen, end); - sb.append(labelsSet.getLabel(name)); + sb.append(textsSet.getText(name)); pos = end - 1; } else if (c == ESCAPE_CHAR) { if (sb != null) { @@ -381,7 +381,7 @@ public class KeySpecParser { return text; } - private static int searchLabelNameEnd(String text, int start) { + private static int searchTextNameEnd(String text, int start) { final int size = text.length(); for (int pos = start; pos < size; pos++) { final char c = text.charAt(pos); @@ -395,8 +395,8 @@ public class KeySpecParser { return size; } - public static String[] parseCsvString(String rawText, KeyboardLabelsSet labelsSet) { - final String text = resolveLabelReference(rawText, labelsSet); + public static String[] parseCsvString(String rawText, KeyboardTextsSet textsSet) { + final String text = resolveTextReference(rawText, textsSet); final int size = text.length(); if (size == 0) { return null; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java index 922a44158..b32172ebe 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java @@ -35,19 +35,19 @@ public class KeyStyles { private final HashMap mStyles = new HashMap(); - private final KeyboardLabelsSet mLabelsSet; + private final KeyboardTextsSet mTextsSet; private final KeyStyle mEmptyKeyStyle; - public KeyStyles(KeyboardLabelsSet labelsSet) { - mLabelsSet = labelsSet; - mEmptyKeyStyle = new EmptyKeyStyle(labelsSet); + public KeyStyles(KeyboardTextsSet textsSet) { + mTextsSet = textsSet; + mEmptyKeyStyle = new EmptyKeyStyle(textsSet); } public static abstract class KeyStyle { - protected final KeyboardLabelsSet mLabelsSet; + protected final KeyboardTextsSet mTextsSet; - public KeyStyle(KeyboardLabelsSet labelsSet) { - mLabelsSet = labelsSet; + public KeyStyle(KeyboardTextsSet textsSet) { + mTextsSet = textsSet; } public abstract String[] getStringArray(TypedArray a, int index); @@ -57,22 +57,22 @@ public class KeyStyles { protected String parseString(TypedArray a, int index) { if (a.hasValue(index)) { - return KeySpecParser.resolveLabelReference(a.getString(index), mLabelsSet); + return KeySpecParser.resolveTextReference(a.getString(index), mTextsSet); } return null; } protected String[] parseStringArray(TypedArray a, int index) { if (a.hasValue(index)) { - return KeySpecParser.parseCsvString(a.getString(index), mLabelsSet); + return KeySpecParser.parseCsvString(a.getString(index), mTextsSet); } return null; } } private static class EmptyKeyStyle extends KeyStyle { - public EmptyKeyStyle(KeyboardLabelsSet labelsSet) { - super(labelsSet); + public EmptyKeyStyle(KeyboardTextsSet textsSet) { + super(textsSet); } @Override @@ -99,8 +99,8 @@ public class KeyStyles { private static class DeclaredKeyStyle extends KeyStyle { private final HashMap mStyleAttributes = new HashMap(); - public DeclaredKeyStyle(KeyboardLabelsSet labelsSet) { - super(labelsSet); + public DeclaredKeyStyle(KeyboardTextsSet textsSet) { + super(textsSet); } @Override @@ -195,7 +195,7 @@ public class KeyStyles { } } - final DeclaredKeyStyle style = new DeclaredKeyStyle(mLabelsSet); + final DeclaredKeyStyle style = new DeclaredKeyStyle(mTextsSet); if (keyStyleAttr.hasValue(R.styleable.Keyboard_KeyStyle_parentStyle)) { final String parentStyle = keyStyleAttr.getString( R.styleable.Keyboard_KeyStyle_parentStyle); diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardLabelsSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java similarity index 98% rename from java/src/com/android/inputmethod/keyboard/internal/KeyboardLabelsSet.java rename to java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java index 1ba84e505..d0f27a9a8 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardLabelsSet.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java @@ -25,23 +25,23 @@ import java.util.HashMap; /** * !!!!! DO NOT EDIT THIS FILE !!!!! - * This file is generated by tools/makelabel. + * This file is generated by tools/maketext. */ -public final class KeyboardLabelsSet { - // Language to labels map. - private static final HashMap sLocaleToLabelsMap = +public final class KeyboardTextsSet { + // Language to texts map. + private static final HashMap sLocaleToTextsMap = new HashMap(); private static final HashMap sLowerCaseNameToIdsMap = new HashMap(); - private String[] mLabels; - // Resource name to label map. - private HashMap mResourceNameToLabelsMap = new HashMap(); + private String[] mTexts; + // Resource name to text map. + private HashMap mResourceNameToTextsMap = new HashMap(); public void setLanguage(final String language) { - mLabels = sLocaleToLabelsMap.get(language); - if (mLabels == null) { - mLabels = LANGUAGE_DEFAULT; + mTexts = sLocaleToTextsMap.get(language); + if (mTexts == null) { + mTexts = LANGUAGE_DEFAULT; } } @@ -56,31 +56,31 @@ public final class KeyboardLabelsSet { final String packageName = res.getResourcePackageName(referenceId); for (final String resName : resourceNames) { final int resId = res.getIdentifier(resName, "string", packageName); - mResourceNameToLabelsMap.put(resName, res.getString(resId)); + mResourceNameToTextsMap.put(resName, res.getString(resId)); } } - public String getLabel(final String name) { + public String getText(final String name) { String lowerCaseName = null; - String label = mResourceNameToLabelsMap.get(name); - if (label == null) { + String text = mResourceNameToTextsMap.get(name); + if (text == null) { lowerCaseName = name.toLowerCase(); - label = mResourceNameToLabelsMap.get(lowerCaseName); + text = mResourceNameToTextsMap.get(lowerCaseName); } - if (label != null) { - return label; + if (text != null) { + return text; } Integer id = sLowerCaseNameToIdsMap.get(name); if (id == null) { id = sLowerCaseNameToIdsMap.get(lowerCaseName); // lowerCaseName != null } if (id == null) throw new RuntimeException("Unknown label: " + name); - label = (id < mLabels.length) ? mLabels[id] : null; - return (label == null) ? LANGUAGE_DEFAULT[id] : label; + text = (id < mTexts.length) ? mTexts[id] : null; + return (text == null) ? LANGUAGE_DEFAULT[id] : text; } private static final String[] RESOURCE_NAMES = { - // These labels' name should be aligned with the @string/ in values/strings.xml. + // These texts' name should be aligned with the @string/ in values/strings.xml. // Labels for action. "label_go_key", // "label_search_key", @@ -222,7 +222,7 @@ public final class KeyboardLabelsSet { private static final String EMPTY = ""; - /* Default labels */ + /* Default texts */ private static final String[] LANGUAGE_DEFAULT = { /* 0~ */ EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, @@ -344,11 +344,11 @@ public final class KeyboardLabelsSet { // U+2666: "♦" BLACK DIAMOND SUIT // U+2663: "♣" BLACK CLUB SUIT /* 108 */ "\u266A,\u2665,\u2660,\u2666,\u2663", - /* 109 */ "!fixedColumnOrder!2,!hasLabels!,!label/label_time_am,!label/label_time_pm", + /* 109 */ "!fixedColumnOrder!2,!hasLabels!,!text/label_time_am,!text/label_time_pm", /* 110 */ "!icon/settings_key|!code/key_settings", /* 111 */ "!icon/shortcut_key|!code/key_shortcut", - /* 112 */ "!hasLabels!,!label/label_next_key|!code/key_action_next", - /* 113 */ "!hasLabels!,!label/label_previous_key|!code/key_action_previous", + /* 112 */ "!hasLabels!,!text/label_next_key|!code/key_action_next", + /* 113 */ "!hasLabels!,!text/label_previous_key|!code/key_action_previous", // Label for "switch to more symbol" modifier key. Must be short to fit on key! /* 114 */ "= \\ <", // Label for "switch to more symbol" modifier key on tablets. Must be short to fit on key! @@ -2458,7 +2458,7 @@ public final class KeyboardLabelsSet { /* 19 */ "\u0175", }; - private static final Object[] LANGUAGES_AND_LABELS = { + private static final Object[] LANGUAGES_AND_TEXTS = { "DEFAULT", LANGUAGE_DEFAULT, /* default */ "ar", LANGUAGE_ar, /* Arabic */ "be", LANGUAGE_be, /* Belarusian */ @@ -2505,10 +2505,10 @@ public final class KeyboardLabelsSet { sLowerCaseNameToIdsMap.put(name, id++); } - for (int i = 0; i < LANGUAGES_AND_LABELS.length; i += 2) { - final String language = (String)LANGUAGES_AND_LABELS[i]; - final String[] labels = (String[])LANGUAGES_AND_LABELS[i + 1]; - sLocaleToLabelsMap.put(language, labels); + for (int i = 0; i < LANGUAGES_AND_TEXTS.length; i += 2) { + final String language = (String)LANGUAGES_AND_TEXTS[i]; + final String[] texts = (String[])LANGUAGES_AND_TEXTS[i + 1]; + sLocaleToTextsMap.put(language, texts); } } } diff --git a/tests/res/values/donottranslate.xml b/tests/res/values/donottranslate.xml index 875a55804..3f7634a03 100644 --- a/tests/res/values/donottranslate.xml +++ b/tests/res/values/donottranslate.xml @@ -50,13 +50,13 @@ " \\abc , d\\ef , gh\\i " "ab\\\\,d\\\\\\,,g\\,i" " ab\\\\ , d\\\\\\, , g\\,i " - !label/multiple_chars - x,!label/multiple_chars,y - !label/indirect_string - infinite,!label/infinite_indirection,loop - !LABEL/MULTIPLE_CHARS - x,!LABEL/MULTIPLE_CHARS,y - !LABEL/UPPER_INDIRECT_STRING - infinite,!LABEL/INFINITE_INDIRECTION,loop - !fixedColumnOrder!2,!label/action_previous_as_more_key,!label/action_next_as_more_key + !text/multiple_chars + x,!text/multiple_chars,y + !text/indirect_string + infinite,!text/infinite_indirection,loop + !TEXT/MULTIPLE_CHARS + x,!TEXT/MULTIPLE_CHARS,y + !TEXT/UPPER_INDIRECT_STRING + infinite,!TEXT/INFINITE_INDIRECTION,loop + !fixedColumnOrder!2,!text/action_previous_as_more_key,!text/action_next_as_more_key diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java index a117a5a65..19912c4e4 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserCsvTests.java @@ -24,17 +24,17 @@ import java.util.Arrays; import java.util.Locale; public class KeySpecParserCsvTests extends AndroidTestCase { - private final KeyboardLabelsSet mLabelsSet = new KeyboardLabelsSet(); + private final KeyboardTextsSet mTextsSet = new KeyboardTextsSet(); @Override protected void setUp() throws Exception { super.setUp(); - mLabelsSet.setLanguage(Locale.ENGLISH.getLanguage()); - mLabelsSet.loadStringResources(getContext()); + mTextsSet.setLanguage(Locale.ENGLISH.getLanguage()); + mTextsSet.loadStringResources(getContext()); final String[] testResourceNames = getAllResourceIdNames( com.android.inputmethod.latin.tests.R.string.class); - mLabelsSet.loadStringResourcesInternal(getTestContext(), + mTextsSet.loadStringResourcesInternal(getTestContext(), testResourceNames, com.android.inputmethod.latin.tests.R.string.empty_string); } @@ -68,7 +68,7 @@ public class KeySpecParserCsvTests extends AndroidTestCase { } private void assertTextArray(String message, String value, String ... expectedArray) { - final String[] actual = KeySpecParser.parseCsvString(value, mLabelsSet); + final String[] actual = KeySpecParser.parseCsvString(value, mTextsSet); final String[] expected = (expectedArray.length == 0) ? null : expectedArray; assertArrayEquals(message, expected, actual); } @@ -122,10 +122,10 @@ public class KeySpecParserCsvTests extends AndroidTestCase { "ab" + SURROGATE1 + "cd", "ab" + SURROGATE1 + "cd"); - assertTextArray("Incomplete resource reference 1", "label", "label"); - assertTextArray("Incomplete resource reference 2", "!label", "!label"); - assertTextArray("Incomplete RESOURCE REFERENCE 2", "!LABEL", "!LABEL"); - assertTextArray("Incomplete resource reference 3", "label/", "label/"); + assertTextArray("Incomplete resource reference 1", "text", "text"); + assertTextArray("Incomplete resource reference 2", "!text", "!text"); + assertTextArray("Incomplete RESOURCE REFERENCE 2", "!TEXT", "!TEXT"); + assertTextArray("Incomplete resource reference 3", "text/", "text/"); assertTextArray("Incomplete resource reference 4", "!" + SURROGATE2, "!" + SURROGATE2); } @@ -157,11 +157,11 @@ public class KeySpecParserCsvTests extends AndroidTestCase { assertTextArray("Escaped surrogate with escape", PAIR1 + "\\\\" + PAIR2, PAIR1 + "\\\\" + PAIR2); - assertTextArray("Escaped !label", "\\!label", "\\!label"); - assertTextArray("Escaped !label/", "\\!label/", "\\!label/"); - assertTextArray("Escaped !LABEL/", "\\!LABEL/", "\\!LABEL/"); - assertTextArray("Escaped !label/name", "\\!label/empty_string", "\\!label/empty_string"); - assertTextArray("Escaped !LABEL/NAME", "\\!LABEL/EMPTY_STRING", "\\!LABEL/EMPTY_STRING"); + assertTextArray("Escaped !text", "\\!text", "\\!text"); + assertTextArray("Escaped !text/", "\\!text/", "\\!text/"); + assertTextArray("Escaped !TEXT/", "\\!TEXT/", "\\!TEXT/"); + assertTextArray("Escaped !text/name", "\\!text/empty_string", "\\!text/empty_string"); + assertTextArray("Escaped !TEXT/NAME", "\\!TEXT/EMPTY_STRING", "\\!TEXT/EMPTY_STRING"); } public void testParseCsvTextMulti() { @@ -192,204 +192,204 @@ public class KeySpecParserCsvTests extends AndroidTestCase { assertTextArray("Multiple labels with comma and escape surrounded by spaces", " ab\\\\ , d\\\\\\, , g\\,i ", " ab\\\\ ", " d\\\\\\, ", " g\\,i "); - assertTextArray("Multiple escaped !label", "\\!,\\!label/empty_string", - "\\!", "\\!label/empty_string"); - assertTextArray("Multiple escaped !LABEL", "\\!,\\!LABEL/EMPTY_STRING", - "\\!", "\\!LABEL/EMPTY_STRING"); + assertTextArray("Multiple escaped !text", "\\!,\\!text/empty_string", + "\\!", "\\!text/empty_string"); + assertTextArray("Multiple escaped !TEXT", "\\!,\\!TEXT/EMPTY_STRING", + "\\!", "\\!TEXT/EMPTY_STRING"); } public void testParseCsvResourceError() { - assertError("Incomplete resource name", "!label/", "!label/"); - assertError("Non existing resource", "!label/non_existing"); + assertError("Incomplete resource name", "!text/", "!text/"); + assertError("Non existing resource", "!text/non_existing"); } public void testParseCsvResourceZero() { assertTextArray("Empty string", - "!label/empty_string"); + "!text/empty_string"); assertTextArray("EMPTY STRING", - "!LABEL/EMPTY_STRING"); + "!TEXT/EMPTY_STRING"); } public void testParseCsvResourceSingle() { assertTextArray("Single char", - "!label/single_char", "a"); + "!text/single_char", "a"); assertTextArray("SINGLE CHAR", - "!LABEL/SINGLE_CHAR", "a"); + "!TEXT/SINGLE_CHAR", "a"); assertTextArray("Space", - "!label/space", " "); + "!text/space", " "); assertTextArray("Single label", - "!label/single_label", "abc"); + "!text/single_label", "abc"); assertTextArray("Spaces", - "!label/spaces", " "); + "!text/spaces", " "); assertTextArray("Spaces in label", - "!label/spaces_in_label", "a b c"); + "!text/spaces_in_label", "a b c"); assertTextArray("Spaces at beginning of label", - "!label/spaces_at_beginning_of_label", " abc"); + "!text/spaces_at_beginning_of_label", " abc"); assertTextArray("Spaces at end of label", - "!label/spaces_at_end_of_label", "abc "); + "!text/spaces_at_end_of_label", "abc "); assertTextArray("label surrounded by spaces", - "!label/label_surrounded_by_spaces", " abc "); + "!text/label_surrounded_by_spaces", " abc "); assertTextArray("Escape and single char", - "\\\\!label/single_char", "\\\\a"); + "\\\\!text/single_char", "\\\\a"); assertTextArray("Escape and SINGLE CHAR", - "\\\\!LABEL/SINGLE_CHAR", "\\\\a"); + "\\\\!TEXT/SINGLE_CHAR", "\\\\a"); } public void testParseCsvResourceSingleEscaped() { assertTextArray("Escaped char", - "!label/escaped_char", "\\a"); + "!text/escaped_char", "\\a"); assertTextArray("Escaped comma", - "!label/escaped_comma", "\\,"); + "!text/escaped_comma", "\\,"); assertTextArray("Escaped comma escape", - "!label/escaped_comma_escape", "a\\,\\"); + "!text/escaped_comma_escape", "a\\,\\"); assertTextArray("Escaped escape", - "!label/escaped_escape", "\\\\"); + "!text/escaped_escape", "\\\\"); assertTextArray("Escaped label", - "!label/escaped_label", "a\\bc"); + "!text/escaped_label", "a\\bc"); assertTextArray("Escaped label at beginning", - "!label/escaped_label_at_beginning", "\\abc"); + "!text/escaped_label_at_beginning", "\\abc"); assertTextArray("Escaped label at end", - "!label/escaped_label_at_end", "abc\\"); + "!text/escaped_label_at_end", "abc\\"); assertTextArray("Escaped label with comma", - "!label/escaped_label_with_comma", "a\\,c"); + "!text/escaped_label_with_comma", "a\\,c"); assertTextArray("Escaped label with comma at beginning", - "!label/escaped_label_with_comma_at_beginning", "\\,bc"); + "!text/escaped_label_with_comma_at_beginning", "\\,bc"); assertTextArray("Escaped label with comma at end", - "!label/escaped_label_with_comma_at_end", "ab\\,"); + "!text/escaped_label_with_comma_at_end", "ab\\,"); assertTextArray("Escaped label with successive", - "!label/escaped_label_with_successive", "\\,\\\\bc"); + "!text/escaped_label_with_successive", "\\,\\\\bc"); assertTextArray("Escaped label with escape", - "!label/escaped_label_with_escape", "a\\\\c"); + "!text/escaped_label_with_escape", "a\\\\c"); } public void testParseCsvResourceMulti() { assertTextArray("Multiple chars", - "!label/multiple_chars", "a", "b", "c"); + "!text/multiple_chars", "a", "b", "c"); assertTextArray("MULTIPLE CHARS", - "!LABEL/MULTIPLE_CHARS", "a", "b", "c"); + "!TEXT/MULTIPLE_CHARS", "a", "b", "c"); assertTextArray("Multiple chars surrounded by spaces", - "!label/multiple_chars_surrounded_by_spaces", + "!text/multiple_chars_surrounded_by_spaces", " a ", " b ", " c "); assertTextArray("Multiple labels", - "!label/multiple_labels", "abc", "def", "ghi"); + "!text/multiple_labels", "abc", "def", "ghi"); assertTextArray("Multiple labels surrounded by spaces", - "!label/multiple_labels_surrounded_by_spaces", " abc ", " def ", " ghi "); + "!text/multiple_labels_surrounded_by_spaces", " abc ", " def ", " ghi "); } public void testParseCsvResourcetMultiEscaped() { assertTextArray("Multiple chars with comma", - "!label/multiple_chars_with_comma", + "!text/multiple_chars_with_comma", "a", "\\,", "c"); assertTextArray("Multiple chars with comma surrounded by spaces", - "!label/multiple_chars_with_comma_surrounded_by_spaces", + "!text/multiple_chars_with_comma_surrounded_by_spaces", " a ", " \\, ", " c "); assertTextArray("Multiple labels with escape", - "!label/multiple_labels_with_escape", + "!text/multiple_labels_with_escape", "\\abc", "d\\ef", "gh\\i"); assertTextArray("Multiple labels with escape surrounded by spaces", - "!label/multiple_labels_with_escape_surrounded_by_spaces", + "!text/multiple_labels_with_escape_surrounded_by_spaces", " \\abc ", " d\\ef ", " gh\\i "); assertTextArray("Multiple labels with comma and escape", - "!label/multiple_labels_with_comma_and_escape", + "!text/multiple_labels_with_comma_and_escape", "ab\\\\", "d\\\\\\,", "g\\,i"); assertTextArray("Multiple labels with comma and escape surrounded by spaces", - "!label/multiple_labels_with_comma_and_escape_surrounded_by_spaces", + "!text/multiple_labels_with_comma_and_escape_surrounded_by_spaces", " ab\\\\ ", " d\\\\\\, ", " g\\,i "); } public void testParseMultipleResources() { assertTextArray("Literals and resources", - "1,!label/multiple_chars,z", "1", "a", "b", "c", "z"); + "1,!text/multiple_chars,z", "1", "a", "b", "c", "z"); assertTextArray("Literals and RESOURCES", - "1,!LABEL/MULTIPLE_CHARS,z", "1", "a", "b", "c", "z"); + "1,!TEXT/MULTIPLE_CHARS,z", "1", "a", "b", "c", "z"); assertTextArray("Literals and resources and escape at end", - "\\1,!label/multiple_chars,z\\", "\\1", "a", "b", "c", "z\\"); + "\\1,!text/multiple_chars,z\\", "\\1", "a", "b", "c", "z\\"); assertTextArray("Multiple single resource chars and labels", - "!label/single_char,!label/single_label,!label/escaped_comma", + "!text/single_char,!text/single_label,!text/escaped_comma", "a", "abc", "\\,"); assertTextArray("Multiple single resource chars and labels 2", - "!label/single_char,!label/single_label,!label/escaped_comma_escape", + "!text/single_char,!text/single_label,!text/escaped_comma_escape", "a", "abc", "a\\,\\"); assertTextArray("Multiple single RESOURCE chars and LABELS 2", - "!LABEL/SINGLE_CHAR,!LABEL/SINGLE_LABEL,!LABEL/ESCAPED_COMMA_ESCAPE", + "!TEXT/SINGLE_CHAR,!TEXT/SINGLE_LABEL,!TEXT/ESCAPED_COMMA_ESCAPE", "a", "abc", "a\\,\\"); assertTextArray("Multiple multiple resource chars and labels", - "!label/multiple_chars,!label/multiple_labels,!label/multiple_chars_with_comma", + "!text/multiple_chars,!text/multiple_labels,!text/multiple_chars_with_comma", "a", "b", "c", "abc", "def", "ghi", "a", "\\,", "c"); assertTextArray("Concatenated resources", - "!label/multiple_chars!label/multiple_labels!label/multiple_chars_with_comma", + "!text/multiple_chars!text/multiple_labels!text/multiple_chars_with_comma", "a", "b", "cabc", "def", "ghia", "\\,", "c"); assertTextArray("Concatenated resource and literal", - "abc!label/multiple_labels", + "abc!text/multiple_labels", "abcabc", "def", "ghi"); } public void testParseIndirectReference() { assertTextArray("Indirect", - "!label/indirect_string", "a", "b", "c"); + "!text/indirect_string", "a", "b", "c"); assertTextArray("Indirect with literal", - "1,!label/indirect_string_with_literal,2", "1", "x", "a", "b", "c", "y", "2"); + "1,!text/indirect_string_with_literal,2", "1", "x", "a", "b", "c", "y", "2"); assertTextArray("Indirect2", - "!label/indirect2_string", "a", "b", "c"); + "!text/indirect2_string", "a", "b", "c"); assertTextArray("INDIRECT", - "!LABEL/INDIRECT_STRING", "a", "b", "c"); + "!TEXT/INDIRECT_STRING", "a", "b", "c"); assertTextArray("INDIRECT with literal", - "1,!LABEL/INDIRECT_STRING_WITH_LITERAL,2", "1", "x", "a", "b", "c", "y", "2"); + "1,!TEXT/INDIRECT_STRING_WITH_LITERAL,2", "1", "x", "a", "b", "c", "y", "2"); assertTextArray("INDIRECT2", - "!LABEL/INDIRECT2_STRING", "a", "b", "c"); + "!TEXT/INDIRECT2_STRING", "a", "b", "c"); assertTextArray("Upper indirect", - "!label/upper_indirect_string", "a", "b", "c"); + "!text/upper_indirect_string", "a", "b", "c"); assertTextArray("Upper indirect with literal", - "1,!label/upper_indirect_string_with_literal,2", "1", "x", "a", "b", "c", "y", "2"); + "1,!text/upper_indirect_string_with_literal,2", "1", "x", "a", "b", "c", "y", "2"); assertTextArray("Upper indirect2", - "!label/upper_indirect2_string", "a", "b", "c"); + "!text/upper_indirect2_string", "a", "b", "c"); assertTextArray("UPPER INDIRECT", - "!LABEL/upper_INDIRECT_STRING", "a", "b", "c"); + "!TEXT/upper_INDIRECT_STRING", "a", "b", "c"); assertTextArray("Upper INDIRECT with literal", - "1,!LABEL/upper_INDIRECT_STRING_WITH_LITERAL,2", "1", "x", "a", "b", "c", "y", "2"); + "1,!TEXT/upper_INDIRECT_STRING_WITH_LITERAL,2", "1", "x", "a", "b", "c", "y", "2"); assertTextArray("Upper INDIRECT2", - "!LABEL/upper_INDIRECT2_STRING", "a", "b", "c"); + "!TEXT/upper_INDIRECT2_STRING", "a", "b", "c"); } public void testParseInfiniteIndirectReference() { assertError("Infinite indirection", - "1,!label/infinite_indirection,2", "1", "infinite", "", "loop", "2"); + "1,!text/infinite_indirection,2", "1", "infinite", "", "loop", "2"); assertError("INFINITE INDIRECTION", - "1,!LABEL/INFINITE_INDIRECTION,2", "1", "infinite", "", "loop", "2"); + "1,!TEXT/INFINITE_INDIRECTION,2", "1", "infinite", "", "loop", "2"); assertError("Upper infinite indirection", - "1,!label/upper_infinite_indirection,2", + "1,!text/upper_infinite_indirection,2", "1", "infinite", "", "loop", "2"); assertError("Upper INFINITE INDIRECTION", - "1,!LABEL/UPPER_INFINITE_INDIRECTION,2", + "1,!TEXT/UPPER_INFINITE_INDIRECTION,2", "1", "infinite", "", "loop", "2"); } public void testLabelReferece() { - assertTextArray("Label time am", "!label/label_time_am", "AM"); - assertTextArray("LABEL TIME AM", "!LABEL/LABEL_TIME_AM", "AM"); + assertTextArray("Label time am", "!text/label_time_am", "AM"); + assertTextArray("LABEL TIME AM", "!TEXT/LABEL_TIME_AM", "AM"); - assertTextArray("More keys for am pm", "!label/more_keys_for_am_pm", + assertTextArray("More keys for am pm", "!text/more_keys_for_am_pm", "!fixedColumnOrder!2", "!hasLabels!", "AM", "PM"); - assertTextArray("MORE KEYS FOR AM OM", "!LABEL/MORE_KEYS_FOR_AM_PM", + assertTextArray("MORE KEYS FOR AM OM", "!TEXT/MORE_KEYS_FOR_AM_PM", "!fixedColumnOrder!2", "!hasLabels!", "AM", "PM"); - assertTextArray("Settings as more key", "!label/settings_as_more_key", + assertTextArray("Settings as more key", "!text/settings_as_more_key", "!icon/settings_key|!code/key_settings"); - assertTextArray("SETTINGS AS MORE KEY", "!LABEL/SETTINGS_AS_MORE_KEY", + assertTextArray("SETTINGS AS MORE KEY", "!TEXT/SETTINGS_AS_MORE_KEY", "!icon/settings_key|!code/key_settings"); assertTextArray("Indirect naviagte actions as more key", - "!label/indirect_navigate_actions_as_more_key", + "!text/indirect_navigate_actions_as_more_key", "!fixedColumnOrder!2", "!hasLabels!", "Prev|!code/key_action_previous", "!hasLabels!", "Next|!code/key_action_next"); assertTextArray("INDIRECT NAVIGATE ACTIONS AS MORE KEY", - "!LABEL/INDIRECT_NAVIGATE_ACTIONS_AS_MORE_KEY", + "!TEXT/INDIRECT_NAVIGATE_ACTIONS_AS_MORE_KEY", "!fixedColumnOrder!2", "!hasLabels!", "Prev|!code/key_action_previous", "!hasLabels!", "Next|!code/key_action_next"); diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java index 429557da9..f2a165678 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java @@ -30,7 +30,7 @@ import java.util.Locale; public class KeySpecParserTests extends AndroidTestCase { private final KeyboardCodesSet mCodesSet = new KeyboardCodesSet(); - private final KeyboardLabelsSet mLabelsSet = new KeyboardLabelsSet(); + private final KeyboardTextsSet mTextsSet = new KeyboardTextsSet(); private static final String CODE_SETTINGS = "!code/key_settings"; private static final String ICON_SETTINGS = "!icon/settings_key"; @@ -49,8 +49,8 @@ public class KeySpecParserTests extends AndroidTestCase { final String language = Locale.ENGLISH.getLanguage(); mCodesSet.setLanguage(language); - mLabelsSet.setLanguage(language); - mLabelsSet.loadStringResources(getContext()); + mTextsSet.setLanguage(language); + mTextsSet.loadStringResources(getContext()); mCodeSettings = KeySpecParser.parseCode( CODE_SETTINGS, mCodesSet, CODE_UNSPECIFIED); @@ -61,7 +61,7 @@ public class KeySpecParserTests extends AndroidTestCase { private void assertParser(String message, String moreKeySpec, String expectedLabel, String expectedOutputText, int expectedIcon, int expectedCode) { - final String labelResolved = KeySpecParser.resolveLabelReference(moreKeySpec, mLabelsSet); + final String labelResolved = KeySpecParser.resolveTextReference(moreKeySpec, mTextsSet); final MoreKeySpec spec = new MoreKeySpec(labelResolved, mCodesSet); assertEquals(message + " [label]", expectedLabel, spec.mLabel); assertEquals(message + " [ouptputText]", expectedOutputText, spec.mOutputText); @@ -257,21 +257,21 @@ public class KeySpecParserTests extends AndroidTestCase { } public void testResourceReference() { - assertParser("Settings as more key", "!label/settings_as_more_key", + assertParser("Settings as more key", "!text/settings_as_more_key", null, null, mSettingsIconId, mCodeSettings); - assertParser("SETTINGS AS MORE KEY", "!LABEL/SETTINGS_AS_MORE_KEY", + assertParser("SETTINGS AS MORE KEY", "!TEXT/SETTINGS_AS_MORE_KEY", null, null, mSettingsIconId, mCodeSettings); - assertParser("Action next as more key", "!label/label_next_key|!code/key_action_next", + assertParser("Action next as more key", "!text/label_next_key|!code/key_action_next", "Next", null, ICON_UNDEFINED, mCodeActionNext); - assertParser("ACTION NEXT AS MORE KEY", "!LABEL/LABEL_NEXT_KEY|!CODE/KEY_ACTION_NEXT", + assertParser("ACTION NEXT AS MORE KEY", "!TEXT/LABEL_NEXT_KEY|!CODE/KEY_ACTION_NEXT", "Next", null, ICON_UNDEFINED, mCodeActionNext); assertParser("Popular domain", - "!label/keylabel_for_popular_domain|!label/keylabel_for_popular_domain ", + "!text/keylabel_for_popular_domain|!text/keylabel_for_popular_domain ", ".com", ".com ", ICON_UNDEFINED, CODE_OUTPUT_TEXT); assertParser("POPULAR DOMAIN", - "!LABEL/KEYLABEL_FOR_POPULAR_DOMAIN|!LABEL/KEYLABEL_FOR_POPULAR_DOMAIN ", + "!TEXT/KEYLABEL_FOR_POPULAR_DOMAIN|!TEXT/KEYLABEL_FOR_POPULAR_DOMAIN ", ".com", ".com ", ICON_UNDEFINED, CODE_OUTPUT_TEXT); } diff --git a/tools/makelabel/etc/manifest.txt b/tools/makelabel/etc/manifest.txt deleted file mode 100644 index 18bf0be09..000000000 --- a/tools/makelabel/etc/manifest.txt +++ /dev/null @@ -1 +0,0 @@ -Main-Class: com.android.inputmethod.latin.makelabel.LabelMaker diff --git a/tools/makelabel/Android.mk b/tools/maketext/Android.mk similarity index 97% rename from tools/makelabel/Android.mk rename to tools/maketext/Android.mk index 9fa865084..98731b718 100644 --- a/tools/makelabel/Android.mk +++ b/tools/maketext/Android.mk @@ -20,7 +20,7 @@ LOCAL_SRC_FILES += $(call all-java-files-under,src) LOCAL_JAR_MANIFEST := etc/manifest.txt LOCAL_JAVA_RESOURCE_DIRS := res LOCAL_MODULE_TAGS := eng -LOCAL_MODULE := makelabel +LOCAL_MODULE := maketext include $(BUILD_HOST_JAVA_LIBRARY) include $(LOCAL_PATH)/etc/Android.mk diff --git a/tools/makelabel/etc/Android.mk b/tools/maketext/etc/Android.mk similarity index 94% rename from tools/makelabel/etc/Android.mk rename to tools/maketext/etc/Android.mk index 2d2e9a6ed..4fa194bcd 100644 --- a/tools/makelabel/etc/Android.mk +++ b/tools/maketext/etc/Android.mk @@ -17,5 +17,5 @@ include $(CLEAR_VARS) LOCAL_MODULE_TAGS := eng -LOCAL_PREBUILT_EXECUTABLES := makelabel +LOCAL_PREBUILT_EXECUTABLES := maketext include $(BUILD_HOST_PREBUILT) diff --git a/tools/makelabel/etc/makelabel b/tools/maketext/etc/maketext similarity index 98% rename from tools/makelabel/etc/makelabel rename to tools/maketext/etc/maketext index 44a05b612..0edd36020 100755 --- a/tools/makelabel/etc/makelabel +++ b/tools/maketext/etc/maketext @@ -33,7 +33,7 @@ progdir=`pwd` prog="${progdir}"/`basename "${prog}"` cd "${oldwd}" -jarfile=makelabel.jar +jarfile=maketext.jar frameworkdir="$progdir" if [ ! -r "$frameworkdir/$jarfile" ] then diff --git a/tools/maketext/etc/manifest.txt b/tools/maketext/etc/manifest.txt new file mode 100644 index 000000000..bfd1a52be --- /dev/null +++ b/tools/maketext/etc/manifest.txt @@ -0,0 +1 @@ +Main-Class: com.android.inputmethod.latin.maketext.LabelText diff --git a/tools/makelabel/res/com/android/inputmethod/keyboard/internal/KeyboardLabelsSet.tmpl b/tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl similarity index 65% rename from tools/makelabel/res/com/android/inputmethod/keyboard/internal/KeyboardLabelsSet.tmpl rename to tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl index 72f4edda7..5a193388a 100644 --- a/tools/makelabel/res/com/android/inputmethod/keyboard/internal/KeyboardLabelsSet.tmpl +++ b/tools/maketext/res/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.tmpl @@ -25,23 +25,23 @@ import java.util.HashMap; /** * !!!!! DO NOT EDIT THIS FILE !!!!! - * This file is generated by tools/makelabel. + * This file is generated by tools/maketext. */ -public final class KeyboardLabelsSet { - // Language to labels map. - private static final HashMap sLocaleToLabelsMap = +public final class KeyboardTextsSet { + // Language to texts map. + private static final HashMap sLocaleToTextsMap = new HashMap(); private static final HashMap sLowerCaseNameToIdsMap = new HashMap(); - private String[] mLabels; - // Resource name to label map. - private HashMap mResourceNameToLabelsMap = new HashMap(); + private String[] mTexts; + // Resource name to text map. + private HashMap mResourceNameToTextsMap = new HashMap(); public void setLanguage(final String language) { - mLabels = sLocaleToLabelsMap.get(language); - if (mLabels == null) { - mLabels = LANGUAGE_DEFAULT; + mTexts = sLocaleToTextsMap.get(language); + if (mTexts == null) { + mTexts = LANGUAGE_DEFAULT; } } @@ -56,31 +56,31 @@ public final class KeyboardLabelsSet { final String packageName = res.getResourcePackageName(referenceId); for (final String resName : resourceNames) { final int resId = res.getIdentifier(resName, "string", packageName); - mResourceNameToLabelsMap.put(resName, res.getString(resId)); + mResourceNameToTextsMap.put(resName, res.getString(resId)); } } - public String getLabel(final String name) { + public String getText(final String name) { String lowerCaseName = null; - String label = mResourceNameToLabelsMap.get(name); - if (label == null) { + String text = mResourceNameToTextsMap.get(name); + if (text == null) { lowerCaseName = name.toLowerCase(); - label = mResourceNameToLabelsMap.get(lowerCaseName); + text = mResourceNameToTextsMap.get(lowerCaseName); } - if (label != null) { - return label; + if (text != null) { + return text; } Integer id = sLowerCaseNameToIdsMap.get(name); if (id == null) { id = sLowerCaseNameToIdsMap.get(lowerCaseName); // lowerCaseName != null } if (id == null) throw new RuntimeException("Unknown label: " + name); - label = (id < mLabels.length) ? mLabels[id] : null; - return (label == null) ? LANGUAGE_DEFAULT[id] : label; + text = (id < mTexts.length) ? mTexts[id] : null; + return (text == null) ? LANGUAGE_DEFAULT[id] : text; } private static final String[] RESOURCE_NAMES = { - // These labels' name should be aligned with the @string/ in values/strings.xml. + // These texts' name should be aligned with the @string/ in values/strings.xml. // Labels for action. "label_go_key", // "label_search_key", @@ -102,14 +102,14 @@ public final class KeyboardLabelsSet { private static final String EMPTY = ""; - /* Default labels */ + /* Default texts */ private static final String[] LANGUAGE_DEFAULT = { - /* @DEFAULT_LABELS@ */ + /* @DEFAULT_TEXTS@ */ }; - /* @LABELS@ */ - private static final Object[] LANGUAGES_AND_LABELS = { - /* @LANGUAGES_AND_LABELS@ */ + /* @TEXTS@ */ + private static final Object[] LANGUAGES_AND_TEXTS = { + /* @LANGUAGES_AND_TEXTS@ */ }; static { @@ -118,10 +118,10 @@ public final class KeyboardLabelsSet { sLowerCaseNameToIdsMap.put(name, id++); } - for (int i = 0; i < LANGUAGES_AND_LABELS.length; i += 2) { - final String language = (String)LANGUAGES_AND_LABELS[i]; - final String[] labels = (String[])LANGUAGES_AND_LABELS[i + 1]; - sLocaleToLabelsMap.put(language, labels); + for (int i = 0; i < LANGUAGES_AND_TEXTS.length; i += 2) { + final String language = (String)LANGUAGES_AND_TEXTS[i]; + final String[] texts = (String[])LANGUAGES_AND_TEXTS[i + 1]; + sLocaleToTextsMap.put(language, texts); } } } diff --git a/tools/makelabel/res/values-ar/donottranslate-more-keys.xml b/tools/maketext/res/values-ar/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-ar/donottranslate-more-keys.xml rename to tools/maketext/res/values-ar/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-be/donottranslate-more-keys.xml b/tools/maketext/res/values-be/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-be/donottranslate-more-keys.xml rename to tools/maketext/res/values-be/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-ca/donottranslate-more-keys.xml b/tools/maketext/res/values-ca/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-ca/donottranslate-more-keys.xml rename to tools/maketext/res/values-ca/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-cs/donottranslate-more-keys.xml b/tools/maketext/res/values-cs/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-cs/donottranslate-more-keys.xml rename to tools/maketext/res/values-cs/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-da/donottranslate-more-keys.xml b/tools/maketext/res/values-da/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-da/donottranslate-more-keys.xml rename to tools/maketext/res/values-da/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-de/donottranslate-more-keys.xml b/tools/maketext/res/values-de/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-de/donottranslate-more-keys.xml rename to tools/maketext/res/values-de/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-en/donottranslate-more-keys.xml b/tools/maketext/res/values-en/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-en/donottranslate-more-keys.xml rename to tools/maketext/res/values-en/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-es/donottranslate-more-keys.xml b/tools/maketext/res/values-es/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-es/donottranslate-more-keys.xml rename to tools/maketext/res/values-es/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-et/donottranslate-more-keys.xml b/tools/maketext/res/values-et/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-et/donottranslate-more-keys.xml rename to tools/maketext/res/values-et/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-fa/donottranslate-more-keys.xml b/tools/maketext/res/values-fa/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-fa/donottranslate-more-keys.xml rename to tools/maketext/res/values-fa/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-fi/donottranslate-more-keys.xml b/tools/maketext/res/values-fi/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-fi/donottranslate-more-keys.xml rename to tools/maketext/res/values-fi/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-fr/donottranslate-more-keys.xml b/tools/maketext/res/values-fr/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-fr/donottranslate-more-keys.xml rename to tools/maketext/res/values-fr/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-hi/donottranslate-more-keys.xml b/tools/maketext/res/values-hi/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-hi/donottranslate-more-keys.xml rename to tools/maketext/res/values-hi/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-hr/donottranslate-more-keys.xml b/tools/maketext/res/values-hr/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-hr/donottranslate-more-keys.xml rename to tools/maketext/res/values-hr/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-hu/donottranslate-more-keys.xml b/tools/maketext/res/values-hu/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-hu/donottranslate-more-keys.xml rename to tools/maketext/res/values-hu/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-is/donottranslate-more-keys.xml b/tools/maketext/res/values-is/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-is/donottranslate-more-keys.xml rename to tools/maketext/res/values-is/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-it/donottranslate-more-keys.xml b/tools/maketext/res/values-it/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-it/donottranslate-more-keys.xml rename to tools/maketext/res/values-it/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-iw/donottranslate-more-keys.xml b/tools/maketext/res/values-iw/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-iw/donottranslate-more-keys.xml rename to tools/maketext/res/values-iw/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-ky/donottranslate-more-keys.xml b/tools/maketext/res/values-ky/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-ky/donottranslate-more-keys.xml rename to tools/maketext/res/values-ky/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-lt/donottranslate-more-keys.xml b/tools/maketext/res/values-lt/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-lt/donottranslate-more-keys.xml rename to tools/maketext/res/values-lt/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-lv/donottranslate-more-keys.xml b/tools/maketext/res/values-lv/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-lv/donottranslate-more-keys.xml rename to tools/maketext/res/values-lv/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-mk/donottranslate-more-keys.xml b/tools/maketext/res/values-mk/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-mk/donottranslate-more-keys.xml rename to tools/maketext/res/values-mk/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-nb/donottranslate-more-keys.xml b/tools/maketext/res/values-nb/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-nb/donottranslate-more-keys.xml rename to tools/maketext/res/values-nb/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-nl/donottranslate-more-keys.xml b/tools/maketext/res/values-nl/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-nl/donottranslate-more-keys.xml rename to tools/maketext/res/values-nl/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-pl/donottranslate-more-keys.xml b/tools/maketext/res/values-pl/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-pl/donottranslate-more-keys.xml rename to tools/maketext/res/values-pl/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-pt/donottranslate-more-keys.xml b/tools/maketext/res/values-pt/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-pt/donottranslate-more-keys.xml rename to tools/maketext/res/values-pt/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-rm/donottranslate-more-keys.xml b/tools/maketext/res/values-rm/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-rm/donottranslate-more-keys.xml rename to tools/maketext/res/values-rm/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-ro/donottranslate-more-keys.xml b/tools/maketext/res/values-ro/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-ro/donottranslate-more-keys.xml rename to tools/maketext/res/values-ro/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-ru/donottranslate-more-keys.xml b/tools/maketext/res/values-ru/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-ru/donottranslate-more-keys.xml rename to tools/maketext/res/values-ru/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-sk/donottranslate-more-keys.xml b/tools/maketext/res/values-sk/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-sk/donottranslate-more-keys.xml rename to tools/maketext/res/values-sk/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-sl/donottranslate-more-keys.xml b/tools/maketext/res/values-sl/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-sl/donottranslate-more-keys.xml rename to tools/maketext/res/values-sl/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-sr/donottranslate-more-keys.xml b/tools/maketext/res/values-sr/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-sr/donottranslate-more-keys.xml rename to tools/maketext/res/values-sr/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-sv/donottranslate-more-keys.xml b/tools/maketext/res/values-sv/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-sv/donottranslate-more-keys.xml rename to tools/maketext/res/values-sv/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-tr/donottranslate-more-keys.xml b/tools/maketext/res/values-tr/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-tr/donottranslate-more-keys.xml rename to tools/maketext/res/values-tr/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-uk/donottranslate-more-keys.xml b/tools/maketext/res/values-uk/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-uk/donottranslate-more-keys.xml rename to tools/maketext/res/values-uk/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-vi/donottranslate-more-keys.xml b/tools/maketext/res/values-vi/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-vi/donottranslate-more-keys.xml rename to tools/maketext/res/values-vi/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values-zz/donottranslate-more-keys.xml b/tools/maketext/res/values-zz/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values-zz/donottranslate-more-keys.xml rename to tools/maketext/res/values-zz/donottranslate-more-keys.xml diff --git a/tools/makelabel/res/values/donottranslate-more-keys.xml b/tools/maketext/res/values/donottranslate-more-keys.xml similarity index 100% rename from tools/makelabel/res/values/donottranslate-more-keys.xml rename to tools/maketext/res/values/donottranslate-more-keys.xml diff --git a/tools/makelabel/src/com/android/inputmethod/latin/makelabel/ArrayInitializerFormatter.java b/tools/maketext/src/com/android/inputmethod/latin/maketext/ArrayInitializerFormatter.java similarity index 98% rename from tools/makelabel/src/com/android/inputmethod/latin/makelabel/ArrayInitializerFormatter.java rename to tools/maketext/src/com/android/inputmethod/latin/maketext/ArrayInitializerFormatter.java index 0cf2991b0..3365c7273 100644 --- a/tools/makelabel/src/com/android/inputmethod/latin/makelabel/ArrayInitializerFormatter.java +++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/ArrayInitializerFormatter.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin.makelabel; +package com.android.inputmethod.latin.maketext; import java.io.PrintStream; diff --git a/tools/makelabel/src/com/android/inputmethod/latin/makelabel/JarUtils.java b/tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java similarity index 98% rename from tools/makelabel/src/com/android/inputmethod/latin/makelabel/JarUtils.java rename to tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java index b24b2ca30..366d73e20 100644 --- a/tools/makelabel/src/com/android/inputmethod/latin/makelabel/JarUtils.java +++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/JarUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin.makelabel; +package com.android.inputmethod.latin.maketext; import java.io.IOException; import java.io.InputStream; diff --git a/tools/makelabel/src/com/android/inputmethod/latin/makelabel/LabelMaker.java b/tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java similarity index 92% rename from tools/makelabel/src/com/android/inputmethod/latin/makelabel/LabelMaker.java rename to tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java index e02f80283..a5abcf1c1 100644 --- a/tools/makelabel/src/com/android/inputmethod/latin/makelabel/LabelMaker.java +++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/LabelText.java @@ -14,14 +14,14 @@ * the License. */ -package com.android.inputmethod.latin.makelabel; +package com.android.inputmethod.latin.maketext; import java.util.Arrays; import java.util.LinkedList; import java.util.NoSuchElementException; import java.util.jar.JarFile; -public class LabelMaker { +public class LabelText { static class Options { private static final String OPTION_JAVA = "-java"; @@ -58,7 +58,7 @@ public class LabelMaker { public static void main(final String[] args) { final Options options = new Options(args); - final JarFile jar = JarUtils.getJarFile(LabelMaker.class.getClassLoader()); + final JarFile jar = JarUtils.getJarFile(LabelText.class.getClassLoader()); final MoreKeysResources resources = new MoreKeysResources(jar); resources.writeToJava(options.mJava); } diff --git a/tools/makelabel/src/com/android/inputmethod/latin/makelabel/MoreKeysResources.java b/tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java similarity index 89% rename from tools/makelabel/src/com/android/inputmethod/latin/makelabel/MoreKeysResources.java rename to tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java index 1dfb8533f..a4835932b 100644 --- a/tools/makelabel/src/com/android/inputmethod/latin/makelabel/MoreKeysResources.java +++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/MoreKeysResources.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin.makelabel; +package com.android.inputmethod.latin.maketext; import java.io.Closeable; import java.io.File; @@ -30,13 +30,13 @@ import java.util.Locale; import java.util.jar.JarFile; public class MoreKeysResources { - private static final String LABEL_RESOURCE_NAME = "donottranslate-more-keys.xml"; + private static final String TEXT_RESOURCE_NAME = "donottranslate-more-keys.xml"; - private static final String JAVA_TEMPLATE = "KeyboardLabelsSet.tmpl"; + private static final String JAVA_TEMPLATE = "KeyboardTextsSet.tmpl"; private static final String MARK_NAMES = "@NAMES@"; - private static final String MARK_DEFAULT_LABELS = "@DEFAULT_LABELS@"; - private static final String MARK_LABELS = "@LABELS@"; - private static final String MARK_LANGUAGES_AND_LABELS = "@LANGUAGES_AND_LABELS@"; + private static final String MARK_DEFAULT_TEXTS = "@DEFAULT_TEXTS@"; + private static final String MARK_TEXTS = "@TEXTS@"; + private static final String MARK_LANGUAGES_AND_TEXTS = "@LANGUAGES_AND_TEXTS@"; private static final String DEFAUT_LANGUAGE_NAME = "DEFAULT"; private static final String ARRAY_NAME_FOR_LANGUAGE = "LANGUAGE_%s"; private static final String EMPTY_STRING_VAR = "EMPTY"; @@ -53,7 +53,7 @@ public class MoreKeysResources { public MoreKeysResources(final JarFile jar) { mJar = jar; - final ArrayList resources = JarUtils.getNameListing(jar, LABEL_RESOURCE_NAME); + final ArrayList resources = JarUtils.getNameListing(jar, TEXT_RESOURCE_NAME); for (final String name : resources) { final String dirName = name.substring(0, name.lastIndexOf('/')); final int pos = dirName.lastIndexOf('/'); @@ -118,11 +118,11 @@ public class MoreKeysResources { while ((line = in.readLine()) != null) { if (line.contains(MARK_NAMES)) { dumpNames(out); - } else if (line.contains(MARK_DEFAULT_LABELS)) { - dumpDefaultLabels(out); - } else if (line.contains(MARK_LABELS)) { - dumpLabels(out); - } else if (line.contains(MARK_LANGUAGES_AND_LABELS)) { + } else if (line.contains(MARK_DEFAULT_TEXTS)) { + dumpDefaultTexts(out); + } else if (line.contains(MARK_TEXTS)) { + dumpTexts(out); + } else if (line.contains(MARK_LANGUAGES_AND_TEXTS)) { dumpLanguageMap(out); } else { out.println(line); @@ -140,12 +140,12 @@ public class MoreKeysResources { } } - private void dumpDefaultLabels(final PrintStream out) { + private void dumpDefaultTexts(final PrintStream out) { final StringResourceMap defaultResMap = mResourcesMap.get(DEFAUT_LANGUAGE_NAME); - dumpLabelsInternal(out, defaultResMap, defaultResMap); + dumpTextsInternal(out, defaultResMap, defaultResMap); } - private void dumpLabels(final PrintStream out) { + private void dumpTexts(final PrintStream out) { final StringResourceMap defaultResMap = mResourcesMap.get(DEFAUT_LANGUAGE_NAME); final ArrayList allLanguages = new ArrayList(); allLanguages.addAll(mResourcesMap.keySet()); @@ -158,7 +158,7 @@ public class MoreKeysResources { out.format(" private static final String[] " + ARRAY_NAME_FOR_LANGUAGE + " = {\n", language); final StringResourceMap resMap = mResourcesMap.get(language); - dumpLabelsInternal(out, resMap, defaultResMap); + dumpTextsInternal(out, resMap, defaultResMap); out.format(" };\n\n"); } } @@ -181,7 +181,7 @@ public class MoreKeysResources { } } - private static void dumpLabelsInternal(final PrintStream out, final StringResourceMap resMap, + private static void dumpTextsInternal(final PrintStream out, final StringResourceMap resMap, final StringResourceMap defaultResMap) { final ArrayInitializerFormatter formatter = new ArrayInitializerFormatter(out, 100, " "); @@ -235,7 +235,7 @@ public class MoreKeysResources { String t = text; t = replaceAll(t, "\\?", "?"); t = replaceAll(t, "\\@", "@"); - t = replaceAll(t, "@string/", "!label/"); + t = replaceAll(t, "@string/", "!text/"); return t; } diff --git a/tools/makelabel/src/com/android/inputmethod/latin/makelabel/StringResource.java b/tools/maketext/src/com/android/inputmethod/latin/maketext/StringResource.java similarity index 94% rename from tools/makelabel/src/com/android/inputmethod/latin/makelabel/StringResource.java rename to tools/maketext/src/com/android/inputmethod/latin/maketext/StringResource.java index 793483ce1..568a896a9 100644 --- a/tools/makelabel/src/com/android/inputmethod/latin/makelabel/StringResource.java +++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/StringResource.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin.makelabel; +package com.android.inputmethod.latin.maketext; public class StringResource { public final String mName; diff --git a/tools/makelabel/src/com/android/inputmethod/latin/makelabel/StringResourceMap.java b/tools/maketext/src/com/android/inputmethod/latin/maketext/StringResourceMap.java similarity index 98% rename from tools/makelabel/src/com/android/inputmethod/latin/makelabel/StringResourceMap.java rename to tools/maketext/src/com/android/inputmethod/latin/maketext/StringResourceMap.java index 764421f10..6ceea5a37 100644 --- a/tools/makelabel/src/com/android/inputmethod/latin/makelabel/StringResourceMap.java +++ b/tools/maketext/src/com/android/inputmethod/latin/maketext/StringResourceMap.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin.makelabel; +package com.android.inputmethod.latin.maketext; import org.xml.sax.Attributes; import org.xml.sax.SAXException;