Fix confusable "label" usage, use "text" instead

* Rename makelabel tool to maketext
* Rename KeyboardLablesSet class to KeyboardTextsSet
* Rename "!label/name" to "!text/name"

Change-Id: Ia9494a89fe56f20ca8e8fedb253adbcf8b771bd3
main
Tadashi G. Takaoka 2012-04-20 08:39:11 +09:00
parent cf41aff251
commit 6bfd5f6319
101 changed files with 428 additions and 428 deletions

View File

@ -29,7 +29,7 @@
<Key <Key
latin:keyStyle="shortcutKeyStyle" latin:keyStyle="shortcutKeyStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!label/settings_as_more_key" latin:moreKeys="!text/settings_as_more_key"
latin:keyWidth="fillBoth" /> latin:keyWidth="fillBoth" />
</case> </case>
<case <case

View File

@ -92,7 +92,7 @@
latin:keyLabel=":-)" latin:keyLabel=":-)"
latin:keyOutputText=":-) " latin:keyOutputText=":-) "
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!label/more_keys_for_smiley" /> latin:moreKeys="!text/more_keys_for_smiley" />
<key-style <key-style
latin:styleName="shortcutKeyStyle" latin:styleName="shortcutKeyStyle"
latin:code="!code/key_shortcut" latin:code="!code/key_shortcut"
@ -130,32 +130,32 @@
<key-style <key-style
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:code="!code/key_switch_alpha_symbol" latin:code="!code/key_switch_alpha_symbol"
latin:keyLabel="!label/label_to_symbol_key" latin:keyLabel="!text/label_to_symbol_key"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="toAlphaKeyStyle" latin:styleName="toAlphaKeyStyle"
latin:code="!code/key_switch_alpha_symbol" latin:code="!code/key_switch_alpha_symbol"
latin:keyLabel="!label/label_to_alpha_key" latin:keyLabel="!text/label_to_alpha_key"
latin:keyLabelFlags="preserveCase" latin:keyLabelFlags="preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="toMoreSymbolKeyStyle" latin:styleName="toMoreSymbolKeyStyle"
latin:code="!code/key_shift" latin:code="!code/key_shift"
latin:keyLabel="!label/label_to_more_symbol_for_tablet_key" latin:keyLabel="!text/label_to_more_symbol_for_tablet_key"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="backFromMoreSymbolKeyStyle" latin:styleName="backFromMoreSymbolKeyStyle"
latin:code="!code/key_shift" latin:code="!code/key_shift"
latin:keyLabel="!label/label_to_symbol_key" latin:keyLabel="!text/label_to_symbol_key"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="comKeyStyle" latin:styleName="comKeyStyle"
latin:keyLabel="!label/keylabel_for_popular_domain" latin:keyLabel="!text/keylabel_for_popular_domain"
latin:keyLabelFlags="fontNormal|hasPopupHint|preserveCase" latin:keyLabelFlags="fontNormal|hasPopupHint|preserveCase"
latin:keyOutputText="!label/keylabel_for_popular_domain" latin:keyOutputText="!text/keylabel_for_popular_domain"
latin:moreKeys="!label/more_keys_for_popular_domain" /> latin:moreKeys="!text/more_keys_for_popular_domain" />
</merge> </merge>

View File

@ -39,9 +39,9 @@
</case> </case>
<default> <default>
<Key <Key
latin:keyLabel="!label/keylabel_for_apostrophe" latin:keyLabel="!text/keylabel_for_apostrophe"
latin:keyHintLabel="!label/keyhintlabel_for_apostrophe" latin:keyHintLabel="!text/keyhintlabel_for_apostrophe"
latin:moreKeys="!label/more_keys_for_apostrophe" latin:moreKeys="!text/more_keys_for_apostrophe"
latin:keyStyle="hasShiftedLetterHintStyle" /> latin:keyStyle="hasShiftedLetterHintStyle" />
</default> </default>
</switch> </switch>
@ -54,9 +54,9 @@
</case> </case>
<default> <default>
<Key <Key
latin:keyLabel="!label/keylabel_for_dash" latin:keyLabel="!text/keylabel_for_dash"
latin:keyHintLabel="!label/keyhintlabel_for_dash" latin:keyHintLabel="!text/keyhintlabel_for_dash"
latin:moreKeys="!label/more_keys_for_dash" latin:moreKeys="!text/more_keys_for_dash"
latin:keyStyle="hasShiftedLetterHintStyle" /> latin:keyStyle="hasShiftedLetterHintStyle" />
</default> </default>
</switch> </switch>

View File

@ -32,14 +32,14 @@
</case> </case>
<default> <default>
<Key <Key
latin:keyLabel="!label/keylabel_for_tablet_comma" latin:keyLabel="!text/keylabel_for_tablet_comma"
latin:keyHintLabel="!label/keyhintlabel_for_tablet_comma" latin:keyHintLabel="!text/keyhintlabel_for_tablet_comma"
latin:moreKeys="!label/more_keys_for_tablet_comma" latin:moreKeys="!text/more_keys_for_tablet_comma"
latin:keyStyle="hasShiftedLetterHintStyle" /> latin:keyStyle="hasShiftedLetterHintStyle" />
<Key <Key
latin:keyLabel="." latin:keyLabel="."
latin:keyHintLabel="!label/keyhintlabel_for_tablet_period" latin:keyHintLabel="!text/keyhintlabel_for_tablet_period"
latin:moreKeys="!label/more_keys_for_tablet_period" latin:moreKeys="!text/more_keys_for_tablet_period"
latin:keyStyle="hasShiftedLetterHintStyle" /> latin:keyStyle="hasShiftedLetterHintStyle" />
</default> </default>
</switch> </switch>

View File

@ -26,13 +26,13 @@
<Key <Key
latin:keyStyle="currencyKeyStyle" /> latin:keyStyle="currencyKeyStyle" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_percent" latin:keyLabel="!text/keylabel_for_symbols_percent"
latin:moreKeys="!label/more_keys_for_symbols_percent" /> latin:moreKeys="!text/more_keys_for_symbols_percent" />
<Key <Key
latin:keyLabel="&amp;" /> latin:keyLabel="&amp;" />
<Key <Key
latin:keyLabel="*" latin:keyLabel="*"
latin:moreKeys="!label/more_keys_for_star" /> latin:moreKeys="!text/more_keys_for_star" />
<!-- U+2013: "" EN DASH <!-- U+2013: "" EN DASH
U+2014: "—" EM DASH --> U+2014: "—" EM DASH -->
<Key <Key
@ -40,7 +40,7 @@
latin:moreKeys="_,&#x2013;,&#x2014;" /> latin:moreKeys="_,&#x2013;,&#x2014;" />
<Key <Key
latin:keyLabel="+" latin:keyLabel="+"
latin:moreKeys="!label/more_keys_for_plus" /> latin:moreKeys="!text/more_keys_for_plus" />
<include <include
latin:keyboardLayout="@xml/keys_parentheses" /> latin:keyboardLayout="@xml/keys_parentheses" />
</merge> </merge>

View File

@ -41,11 +41,11 @@
</default> </default>
</switch> </switch>
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_semicolon" latin:keyLabel="!text/keylabel_for_symbols_semicolon"
latin:moreKeys="!label/more_keys_for_symbols_semicolon" /> latin:moreKeys="!text/more_keys_for_symbols_semicolon" />
<Key <Key
latin:keyLabel="!label/keylabel_for_comma" latin:keyLabel="!text/keylabel_for_comma"
latin:moreKeys="!label/more_keys_for_comma" /> latin:moreKeys="!text/more_keys_for_comma" />
<Key <Key
latin:keyLabel="." /> latin:keyLabel="." />
<!-- U+00A1: "¡" INVERTED EXCLAMATION MARK --> <!-- U+00A1: "¡" INVERTED EXCLAMATION MARK -->
@ -53,6 +53,6 @@
latin:keyLabel="!" latin:keyLabel="!"
latin:moreKeys="&#x00A1;" /> latin:moreKeys="&#x00A1;" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_question" latin:keyLabel="!text/keylabel_for_symbols_question"
latin:moreKeys="!label/more_keys_for_symbols_question" /> latin:moreKeys="!text/more_keys_for_symbols_question" />
</merge> </merge>

View File

@ -30,7 +30,7 @@
<!-- U+2022: "•" BULLET --> <!-- U+2022: "•" BULLET -->
<Key <Key
latin:keyLabel="&#x2022;" latin:keyLabel="&#x2022;"
latin:moreKeys="!label/more_keys_for_bullet" /> latin:moreKeys="!text/more_keys_for_bullet" />
<!-- U+221A: "√" SQUARE ROOT --> <!-- U+221A: "√" SQUARE ROOT -->
<Key <Key
latin:keyLabel="&#x221A;" /> latin:keyLabel="&#x221A;" />

View File

@ -70,7 +70,7 @@
<Key <Key
latin:keyLabel="," latin:keyLabel=","
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="!label/more_keys_for_am_pm" latin:moreKeys="!text/more_keys_for_am_pm"
latin:keyStyle="numKeyStyle" latin:keyStyle="numKeyStyle"
latin:keyWidth="9.25%p" /> latin:keyWidth="9.25%p" />
</case> </case>

View File

@ -37,7 +37,7 @@
latin:keyWidth="39.750%p" /> latin:keyWidth="39.750%p" />
<Key <Key
latin:keyLabel="&quot;" latin:keyLabel="&quot;"
latin:moreKeys="!label/more_keys_for_tablet_double_quote" /> latin:moreKeys="!text/more_keys_for_tablet_double_quote" />
<Key <Key
latin:keyLabel="_" /> latin:keyLabel="_" />
<Spacer <Spacer

View File

@ -91,7 +91,7 @@
latin:keyLabel=":-)" latin:keyLabel=":-)"
latin:keyOutputText=":-) " latin:keyOutputText=":-) "
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!label/more_keys_for_smiley" /> latin:moreKeys="!text/more_keys_for_smiley" />
<key-style <key-style
latin:styleName="shortcutKeyStyle" latin:styleName="shortcutKeyStyle"
latin:code="!code/key_shortcut" latin:code="!code/key_shortcut"
@ -113,7 +113,7 @@
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"
latin:code="!code/key_action_previous" latin:code="!code/key_action_previous"
latin:keyLabel="!label/label_tab_key" latin:keyLabel="!text/label_tab_key"
latin:keyLabelFlags="fontNormal|preserveCase" latin:keyLabelFlags="fontNormal|preserveCase"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</case> </case>
@ -121,7 +121,7 @@
<key-style <key-style
latin:styleName="tabKeyStyle" latin:styleName="tabKeyStyle"
latin:code="!code/key_tab" latin:code="!code/key_tab"
latin:keyLabel="!label/label_tab_key" latin:keyLabel="!text/label_tab_key"
latin:keyLabelFlags="fontNormal|preserveCase" latin:keyLabelFlags="fontNormal|preserveCase"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</default> </default>
@ -129,35 +129,35 @@
<key-style <key-style
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:code="!code/key_switch_alpha_symbol" latin:code="!code/key_switch_alpha_symbol"
latin:keyLabel="!label/label_to_symbol_key" latin:keyLabel="!text/label_to_symbol_key"
latin:keyLabelFlags="fontNormal" latin:keyLabelFlags="fontNormal"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="toAlphaKeyStyle" latin:styleName="toAlphaKeyStyle"
latin:code="!code/key_switch_alpha_symbol" latin:code="!code/key_switch_alpha_symbol"
latin:keyLabel="!label/label_to_alpha_key" latin:keyLabel="!text/label_to_alpha_key"
latin:keyLabelFlags="fontNormal|preserveCase" latin:keyLabelFlags="fontNormal|preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="toMoreSymbolKeyStyle" latin:styleName="toMoreSymbolKeyStyle"
latin:code="!code/key_shift" latin:code="!code/key_shift"
latin:keyLabel="!label/label_to_more_symbol_for_tablet_key" latin:keyLabel="!text/label_to_more_symbol_for_tablet_key"
latin:keyLabelFlags="fontNormal" latin:keyLabelFlags="fontNormal"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="backFromMoreSymbolKeyStyle" latin:styleName="backFromMoreSymbolKeyStyle"
latin:code="!code/key_shift" latin:code="!code/key_shift"
latin:keyLabel="!label/label_to_symbol_key" latin:keyLabel="!text/label_to_symbol_key"
latin:keyLabelFlags="fontNormal" latin:keyLabelFlags="fontNormal"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="comKeyStyle" latin:styleName="comKeyStyle"
latin:keyLabel="!label/keylabel_for_popular_domain" latin:keyLabel="!text/keylabel_for_popular_domain"
latin:keyLabelFlags="fontNormal|hasPopupHint|preserveCase" latin:keyLabelFlags="fontNormal|hasPopupHint|preserveCase"
latin:keyOutputText="!label/keylabel_for_popular_domain" latin:keyOutputText="!text/keylabel_for_popular_domain"
latin:moreKeys="!label/more_keys_for_popular_domain" /> latin:moreKeys="!text/more_keys_for_popular_domain" />
</merge> </merge>

View File

@ -39,9 +39,9 @@
</case> </case>
<default> <default>
<Key <Key
latin:keyLabel="!label/keylabel_for_apostrophe" latin:keyLabel="!text/keylabel_for_apostrophe"
latin:keyHintLabel="!label/keyhintlabel_for_apostrophe" latin:keyHintLabel="!text/keyhintlabel_for_apostrophe"
latin:moreKeys="!label/more_keys_for_apostrophe" latin:moreKeys="!text/more_keys_for_apostrophe"
latin:keyStyle="hasShiftedLetterHintStyle" /> latin:keyStyle="hasShiftedLetterHintStyle" />
</default> </default>
</switch> </switch>
@ -54,9 +54,9 @@
</case> </case>
<default> <default>
<Key <Key
latin:keyLabel="!label/keylabel_for_dash" latin:keyLabel="!text/keylabel_for_dash"
latin:keyHintLabel="!label/keyhintlabel_for_dash" latin:keyHintLabel="!text/keyhintlabel_for_dash"
latin:moreKeys="!label/more_keys_for_dash" latin:moreKeys="!text/more_keys_for_dash"
latin:keyStyle="hasShiftedLetterHintStyle" /> latin:keyStyle="hasShiftedLetterHintStyle" />
</default> </default>
</switch> </switch>

View File

@ -72,7 +72,7 @@
<Key <Key
latin:keyLabel="," latin:keyLabel=","
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="!label/more_keys_for_am_pm" latin:moreKeys="!text/more_keys_for_am_pm"
latin:keyStyle="numKeyStyle" latin:keyStyle="numKeyStyle"
latin:keyWidth="8.047%p" /> latin:keyWidth="8.047%p" />
</case> </case>

View File

@ -37,7 +37,7 @@
latin:keyWidth="37.500%p" /> latin:keyWidth="37.500%p" />
<Key <Key
latin:keyLabel="&quot;" latin:keyLabel="&quot;"
latin:moreKeys="!label/more_keys_for_tablet_double_quote" /> latin:moreKeys="!text/more_keys_for_tablet_double_quote" />
<Key <Key
latin:keyLabel="_" /> latin:keyLabel="_" />
<switch> <switch>

View File

@ -31,7 +31,7 @@
<default> <default>
<Key <Key
latin:keyLabel="\'" latin:keyLabel="\'"
latin:moreKeys="!label/more_keys_for_single_quote" /> latin:moreKeys="!text/more_keys_for_single_quote" />
</default> </default>
</switch> </switch>
</merge> </merge>

View File

@ -35,7 +35,7 @@
<key-style <key-style
latin:styleName="f1MoreKeysStyle" latin:styleName="f1MoreKeysStyle"
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="!label/settings_as_more_key" latin:moreKeys="!text/settings_as_more_key"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</default> </default>
</switch> </switch>
@ -98,7 +98,7 @@
latin:keyLabel=":-)" latin:keyLabel=":-)"
latin:keyOutputText=":-) " latin:keyOutputText=":-) "
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="!label/more_keys_for_smiley" latin:moreKeys="!text/more_keys_for_smiley"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</case> </case>
</switch> </switch>
@ -157,7 +157,7 @@
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:code="!code/key_switch_alpha_symbol" latin:code="!code/key_switch_alpha_symbol"
latin:keyIcon="!icon/shortcut_for_label" 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:keyLabelFlags="withIconRight"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
@ -166,7 +166,7 @@
<key-style <key-style
latin:styleName="toSymbolKeyStyle" latin:styleName="toSymbolKeyStyle"
latin:code="!code/key_switch_alpha_symbol" latin:code="!code/key_switch_alpha_symbol"
latin:keyLabel="!label/label_to_symbol_key" latin:keyLabel="!text/label_to_symbol_key"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</default> </default>
@ -174,27 +174,27 @@
<key-style <key-style
latin:styleName="toAlphaKeyStyle" latin:styleName="toAlphaKeyStyle"
latin:code="!code/key_switch_alpha_symbol" latin:code="!code/key_switch_alpha_symbol"
latin:keyLabel="!label/label_to_alpha_key" latin:keyLabel="!text/label_to_alpha_key"
latin:keyLabelFlags="preserveCase" latin:keyLabelFlags="preserveCase"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="toMoreSymbolKeyStyle" latin:styleName="toMoreSymbolKeyStyle"
latin:code="!code/key_shift" latin:code="!code/key_shift"
latin:keyLabel="!label/label_to_more_symbol_key" latin:keyLabel="!text/label_to_more_symbol_key"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="backFromMoreSymbolKeyStyle" latin:styleName="backFromMoreSymbolKeyStyle"
latin:code="!code/key_shift" latin:code="!code/key_shift"
latin:keyLabel="!label/label_to_symbol_key" latin:keyLabel="!text/label_to_symbol_key"
latin:keyActionFlags="noKeyPreview" latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
<key-style <key-style
latin:styleName="punctuationKeyStyle" latin:styleName="punctuationKeyStyle"
latin:keyLabel="." latin:keyLabel="."
latin:keyHintLabel="!label/keyhintlabel_for_punctuation" latin:keyHintLabel="!text/keyhintlabel_for_punctuation"
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="!label/more_keys_for_punctuation" latin:moreKeys="!text/more_keys_for_punctuation"
latin:backgroundType="functional" /> latin:backgroundType="functional" />
</merge> </merge>

View File

@ -86,7 +86,7 @@
<key-style <key-style
latin:styleName="currencyKeyStyle" latin:styleName="currencyKeyStyle"
latin:keyLabel="&#x20AA;" latin:keyLabel="&#x20AA;"
latin:moreKeys="!label/more_keys_for_currency_general" /> latin:moreKeys="!text/more_keys_for_currency_general" />
<key-style <key-style
latin:styleName="moreCurrency1KeyStyle" latin:styleName="moreCurrency1KeyStyle"
latin:keyLabel="&#x00A3;" /> latin:keyLabel="&#x00A3;" />
@ -112,7 +112,7 @@
<key-style <key-style
latin:styleName="currencyKeyStyle" latin:styleName="currencyKeyStyle"
latin:keyLabel="&#xFDFC;" latin:keyLabel="&#xFDFC;"
latin:moreKeys="!label/more_keys_for_currency_general" /> latin:moreKeys="!text/more_keys_for_currency_general" />
<key-style <key-style
latin:styleName="moreCurrency1KeyStyle" latin:styleName="moreCurrency1KeyStyle"
latin:keyLabel="£" /> latin:keyLabel="£" />
@ -138,7 +138,7 @@
<key-style <key-style
latin:styleName="currencyKeyStyle" latin:styleName="currencyKeyStyle"
latin:keyLabel="&#x00A3;" latin:keyLabel="&#x00A3;"
latin:moreKeys="!label/more_keys_for_currency_pound" /> latin:moreKeys="!text/more_keys_for_currency_pound" />
<key-style <key-style
latin:styleName="moreCurrency1KeyStyle" latin:styleName="moreCurrency1KeyStyle"
latin:keyLabel="&#x20AC;" /> latin:keyLabel="&#x20AC;" />

View File

@ -26,7 +26,7 @@
<key-style <key-style
latin:styleName="currencyKeyStyle" latin:styleName="currencyKeyStyle"
latin:keyLabel="$" latin:keyLabel="$"
latin:moreKeys="!label/more_keys_for_currency_dollar" /> latin:moreKeys="!text/more_keys_for_currency_dollar" />
<key-style <key-style
latin:styleName="moreCurrency1KeyStyle" latin:styleName="moreCurrency1KeyStyle"
latin:keyLabel="&#x00A3;" /> latin:keyLabel="&#x00A3;" />

View File

@ -30,7 +30,7 @@
<key-style <key-style
latin:styleName="navigateMoreKeysStyle" latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!label/action_previous_as_more_key" /> latin:moreKeys="!text/action_previous_as_more_key" />
</case> </case>
<case <case
latin:imeAction="actionNext" latin:imeAction="actionNext"
@ -46,7 +46,7 @@
<key-style <key-style
latin:styleName="navigateMoreKeysStyle" latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!label/action_next_as_more_key" /> latin:moreKeys="!text/action_next_as_more_key" />
</case> </case>
<case <case
latin:imeAction="actionPrevious" latin:imeAction="actionPrevious"
@ -63,7 +63,7 @@
<key-style <key-style
latin:styleName="navigateMoreKeysStyle" latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!label/action_previous_as_more_key,!label/action_next_as_more_key" /> latin:moreKeys="!fixedColumnOrder!2,!needsDividers!,!text/action_previous_as_more_key,!text/action_next_as_more_key" />
</case> </case>
<case <case
latin:navigateNext="true" latin:navigateNext="true"
@ -72,7 +72,7 @@
<key-style <key-style
latin:styleName="navigateMoreKeysStyle" latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!label/action_next_as_more_key" /> latin:moreKeys="!text/action_next_as_more_key" />
</case> </case>
<case <case
latin:navigateNext="false" latin:navigateNext="false"
@ -81,7 +81,7 @@
<key-style <key-style
latin:styleName="navigateMoreKeysStyle" latin:styleName="navigateMoreKeysStyle"
latin:keyLabelFlags="hasPopupHint|preserveCase" latin:keyLabelFlags="hasPopupHint|preserveCase"
latin:moreKeys="!label/action_previous_as_more_key" /> latin:moreKeys="!text/action_previous_as_more_key" />
</case> </case>
<!-- naviagteNext="false" and navigatePrevious="false" --> <!-- naviagteNext="false" and navigatePrevious="false" -->
<default> <default>
@ -119,7 +119,7 @@
> >
<key-style <key-style
latin:styleName="enterKeyStyle" latin:styleName="enterKeyStyle"
latin:keyLabel="!label/label_go_key" latin:keyLabel="!text/label_go_key"
latin:parentStyle="defaultActionKeyStyle" /> latin:parentStyle="defaultActionKeyStyle" />
</case> </case>
<case <case
@ -127,7 +127,7 @@
> >
<key-style <key-style
latin:styleName="enterKeyStyle" latin:styleName="enterKeyStyle"
latin:keyLabel="!label/label_next_key" latin:keyLabel="!text/label_next_key"
latin:parentStyle="defaultActionKeyStyle" /> latin:parentStyle="defaultActionKeyStyle" />
</case> </case>
<case <case
@ -135,7 +135,7 @@
> >
<key-style <key-style
latin:styleName="enterKeyStyle" latin:styleName="enterKeyStyle"
latin:keyLabel="!label/label_previous_key" latin:keyLabel="!text/label_previous_key"
latin:parentStyle="defaultActionKeyStyle" /> latin:parentStyle="defaultActionKeyStyle" />
</case> </case>
<case <case
@ -143,7 +143,7 @@
> >
<key-style <key-style
latin:styleName="enterKeyStyle" latin:styleName="enterKeyStyle"
latin:keyLabel="!label/label_done_key" latin:keyLabel="!text/label_done_key"
latin:parentStyle="defaultActionKeyStyle" /> latin:parentStyle="defaultActionKeyStyle" />
</case> </case>
<case <case
@ -151,7 +151,7 @@
> >
<key-style <key-style
latin:styleName="enterKeyStyle" latin:styleName="enterKeyStyle"
latin:keyLabel="!label/label_send_key" latin:keyLabel="!text/label_send_key"
latin:parentStyle="defaultActionKeyStyle" /> latin:parentStyle="defaultActionKeyStyle" />
</case> </case>
<case <case

View File

@ -100,25 +100,25 @@
<key-style <key-style
latin:styleName="numPhoneToSymbolKeyStyle" latin:styleName="numPhoneToSymbolKeyStyle"
latin:code="!code/key_switch_alpha_symbol" latin:code="!code/key_switch_alpha_symbol"
latin:keyLabel="!label/label_to_phone_symbols_key" latin:keyLabel="!text/label_to_phone_symbols_key"
latin:parentStyle="numModeKeyStyle" /> latin:parentStyle="numModeKeyStyle" />
<key-style <key-style
latin:styleName="numPhoneToNumericKeyStyle" latin:styleName="numPhoneToNumericKeyStyle"
latin:code="!code/key_switch_alpha_symbol" latin:code="!code/key_switch_alpha_symbol"
latin:keyLabel="!label/label_to_phone_numeric_key" latin:keyLabel="!text/label_to_phone_numeric_key"
latin:parentStyle="numModeKeyStyle" /> latin:parentStyle="numModeKeyStyle" />
<!-- U+002C: "," COMMA --> <!-- U+002C: "," COMMA -->
<key-style <key-style
latin:styleName="numPauseKeyStyle" latin:styleName="numPauseKeyStyle"
latin:code="0x002C" latin:code="0x002C"
latin:keyLabel="!label/label_pause_key" latin:keyLabel="!text/label_pause_key"
latin:keyLabelFlags="followKeyHintLabelRatio|autoXScale" latin:keyLabelFlags="followKeyHintLabelRatio|autoXScale"
latin:parentStyle="numKeyBaseStyle" /> latin:parentStyle="numKeyBaseStyle" />
<!-- U+003B: ";" SEMICOLON --> <!-- U+003B: ";" SEMICOLON -->
<key-style <key-style
latin:styleName="numWaitKeyStyle" latin:styleName="numWaitKeyStyle"
latin:code="0x003B" latin:code="0x003B"
latin:keyLabel="!label/label_wait_key" latin:keyLabel="!text/label_wait_key"
latin:keyLabelFlags="followKeyHintLabelRatio|autoXScale" latin:keyLabelFlags="followKeyHintLabelRatio|autoXScale"
latin:parentStyle="numKeyBaseStyle" /> latin:parentStyle="numKeyBaseStyle" />
<key-style <key-style

View File

@ -24,9 +24,9 @@
<Key <Key
latin:keyLabel="&lt;" latin:keyLabel="&lt;"
latin:code="!code/key_less_than" latin:code="!code/key_less_than"
latin:moreKeys="!label/more_keys_for_less_than" /> latin:moreKeys="!text/more_keys_for_less_than" />
<Key <Key
latin:keyLabel="&gt;" latin:keyLabel="&gt;"
latin:code="!code/key_greater_than" latin:code="!code/key_greater_than"
latin:moreKeys="!label/more_keys_for_greater_than" /> latin:moreKeys="!text/more_keys_for_greater_than" />
</merge> </merge>

View File

@ -24,9 +24,9 @@
<Key <Key
latin:keyLabel="(" latin:keyLabel="("
latin:code="!code/key_left_parenthesis" latin:code="!code/key_left_parenthesis"
latin:moreKeys="!label/more_keys_for_left_parenthesis" /> latin:moreKeys="!text/more_keys_for_left_parenthesis" />
<Key <Key
latin:keyLabel=")" latin:keyLabel=")"
latin:code="!code/key_right_parenthesis" latin:code="!code/key_right_parenthesis"
latin:moreKeys="!label/more_keys_for_right_parenthesis" /> latin:moreKeys="!text/more_keys_for_right_parenthesis" />
</merge> </merge>

View File

@ -51,9 +51,9 @@
<!-- latin:hasShortcutKey="false" --> <!-- latin:hasShortcutKey="false" -->
<default> <default>
<Key <Key
latin:keyLabel="!label/keylabel_for_comma" latin:keyLabel="!text/keylabel_for_comma"
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:additionalMoreKeys="!label/more_keys_for_comma" latin:additionalMoreKeys="!text/more_keys_for_comma"
latin:keyStyle="f1MoreKeysStyle" /> latin:keyStyle="f1MoreKeysStyle" />
</default> </default>
</switch> </switch>

View File

@ -25,47 +25,47 @@
latin:keyLabel="a" latin:keyLabel="a"
latin:keyHintLabel="1" latin:keyHintLabel="1"
latin:additionalMoreKeys="1" latin:additionalMoreKeys="1"
latin:moreKeys="!label/more_keys_for_a" /> latin:moreKeys="!text/more_keys_for_a" />
<Key <Key
latin:keyLabel="z" latin:keyLabel="z"
latin:keyHintLabel="2" latin:keyHintLabel="2"
latin:additionalMoreKeys="2" latin:additionalMoreKeys="2"
latin:moreKeys="!label/more_keys_for_z" /> latin:moreKeys="!text/more_keys_for_z" />
<Key <Key
latin:keyLabel="e" latin:keyLabel="e"
latin:keyHintLabel="3" latin:keyHintLabel="3"
latin:additionalMoreKeys="3" latin:additionalMoreKeys="3"
latin:moreKeys="!label/more_keys_for_e" /> latin:moreKeys="!text/more_keys_for_e" />
<Key <Key
latin:keyLabel="r" latin:keyLabel="r"
latin:keyHintLabel="4" latin:keyHintLabel="4"
latin:additionalMoreKeys="4" latin:additionalMoreKeys="4"
latin:moreKeys="!label/more_keys_for_r" /> latin:moreKeys="!text/more_keys_for_r" />
<Key <Key
latin:keyLabel="t" latin:keyLabel="t"
latin:keyHintLabel="5" latin:keyHintLabel="5"
latin:additionalMoreKeys="5" latin:additionalMoreKeys="5"
latin:moreKeys="!label/more_keys_for_t" /> latin:moreKeys="!text/more_keys_for_t" />
<Key <Key
latin:keyLabel="y" latin:keyLabel="y"
latin:keyHintLabel="6" latin:keyHintLabel="6"
latin:additionalMoreKeys="6" latin:additionalMoreKeys="6"
latin:moreKeys="!label/more_keys_for_y" /> latin:moreKeys="!text/more_keys_for_y" />
<Key <Key
latin:keyLabel="u" latin:keyLabel="u"
latin:keyHintLabel="7" latin:keyHintLabel="7"
latin:additionalMoreKeys="7" latin:additionalMoreKeys="7"
latin:moreKeys="!label/more_keys_for_u" /> latin:moreKeys="!text/more_keys_for_u" />
<Key <Key
latin:keyLabel="i" latin:keyLabel="i"
latin:keyHintLabel="8" latin:keyHintLabel="8"
latin:additionalMoreKeys="8" latin:additionalMoreKeys="8"
latin:moreKeys="!label/more_keys_for_i" /> latin:moreKeys="!text/more_keys_for_i" />
<Key <Key
latin:keyLabel="o" latin:keyLabel="o"
latin:keyHintLabel="9" latin:keyHintLabel="9"
latin:additionalMoreKeys="9" latin:additionalMoreKeys="9"
latin:moreKeys="!label/more_keys_for_o" /> latin:moreKeys="!text/more_keys_for_o" />
<Key <Key
latin:keyLabel="p" latin:keyLabel="p"
latin:keyHintLabel="0" latin:keyHintLabel="0"

View File

@ -25,27 +25,27 @@
latin:keyLabel="q" /> latin:keyLabel="q" />
<Key <Key
latin:keyLabel="s" latin:keyLabel="s"
latin:moreKeys="!label/more_keys_for_s" /> latin:moreKeys="!text/more_keys_for_s" />
<Key <Key
latin:keyLabel="d" latin:keyLabel="d"
latin:moreKeys="!label/more_keys_for_d" /> latin:moreKeys="!text/more_keys_for_d" />
<Key <Key
latin:keyLabel="f" /> latin:keyLabel="f" />
<Key <Key
latin:keyLabel="g" latin:keyLabel="g"
latin:moreKeys="!label/more_keys_for_g" /> latin:moreKeys="!text/more_keys_for_g" />
<Key <Key
latin:keyLabel="h" latin:keyLabel="h"
latin:moreKeys="!label/more_keys_for_h" /> latin:moreKeys="!text/more_keys_for_h" />
<Key <Key
latin:keyLabel="j" latin:keyLabel="j"
latin:moreKeys="!label/more_keys_for_j" /> latin:moreKeys="!text/more_keys_for_j" />
<Key <Key
latin:keyLabel="k" latin:keyLabel="k"
latin:moreKeys="!label/more_keys_for_k" /> latin:moreKeys="!text/more_keys_for_k" />
<Key <Key
latin:keyLabel="l" latin:keyLabel="l"
latin:moreKeys="!label/more_keys_for_l" /> latin:moreKeys="!text/more_keys_for_l" />
<Key <Key
latin:keyLabel="m" /> latin:keyLabel="m" />
</merge> </merge>

View File

@ -23,20 +23,20 @@
> >
<Key <Key
latin:keyLabel="w" latin:keyLabel="w"
latin:moreKeys="!label/more_keys_for_w" /> latin:moreKeys="!text/more_keys_for_w" />
<Key <Key
latin:keyLabel="x" /> latin:keyLabel="x" />
<Key <Key
latin:keyLabel="c" latin:keyLabel="c"
latin:moreKeys="!label/more_keys_for_c" /> latin:moreKeys="!text/more_keys_for_c" />
<Key <Key
latin:keyLabel="v" latin:keyLabel="v"
latin:moreKeys="!label/more_keys_for_v" /> latin:moreKeys="!text/more_keys_for_v" />
<Key <Key
latin:keyLabel="b" /> latin:keyLabel="b" />
<Key <Key
latin:keyLabel="n" latin:keyLabel="n"
latin:moreKeys="!label/more_keys_for_n" /> latin:moreKeys="!text/more_keys_for_n" />
<include <include
latin:keyboardLayout="@xml/key_azerty_quote" /> latin:keyboardLayout="@xml/key_azerty_quote" />
</merge> </merge>

View File

@ -36,7 +36,7 @@
latin:keyLabel="&#x0443;" latin:keyLabel="&#x0443;"
latin:keyHintLabel="3" latin:keyHintLabel="3"
latin:additionalMoreKeys="3" latin:additionalMoreKeys="3"
latin:moreKeys="!label/more_keys_for_cyrillic_u" /> latin:moreKeys="!text/more_keys_for_cyrillic_u" />
<!-- U+043A: "к" CYRILLIC SMALL LETTER KA --> <!-- U+043A: "к" CYRILLIC SMALL LETTER KA -->
<Key <Key
latin:keyLabel="&#x043A;" latin:keyLabel="&#x043A;"
@ -47,13 +47,13 @@
latin:keyLabel="&#x0435;" latin:keyLabel="&#x0435;"
latin:keyHintLabel="5" latin:keyHintLabel="5"
latin:additionalMoreKeys="5" latin:additionalMoreKeys="5"
latin:moreKeys="!label/more_keys_for_cyrillic_ye" /> latin:moreKeys="!text/more_keys_for_cyrillic_ye" />
<!-- U+043D: "н" CYRILLIC SMALL LETTER EN --> <!-- U+043D: "н" CYRILLIC SMALL LETTER EN -->
<Key <Key
latin:keyLabel="&#x043D;" latin:keyLabel="&#x043D;"
latin:keyHintLabel="6" latin:keyHintLabel="6"
latin:additionalMoreKeys="6" latin:additionalMoreKeys="6"
latin:moreKeys="!label/more_keys_for_cyrillic_en" /> latin:moreKeys="!text/more_keys_for_cyrillic_en" />
<!-- U+0433: "г" CYRILLIC SMALL LETTER GHE --> <!-- U+0433: "г" CYRILLIC SMALL LETTER GHE -->
<Key <Key
latin:keyLabel="&#x0433;" latin:keyLabel="&#x0433;"
@ -65,7 +65,7 @@
latin:keyHintLabel="8" latin:keyHintLabel="8"
latin:additionalMoreKeys="8" /> latin:additionalMoreKeys="8" />
<Key <Key
latin:keyLabel="!label/keylabel_for_east_slavic_row1_9" latin:keyLabel="!text/keylabel_for_east_slavic_row1_9"
latin:keyHintLabel="9" latin:keyHintLabel="9"
latin:additionalMoreKeys="9" /> latin:additionalMoreKeys="9" />
<!-- U+0437: "з" CYRILLIC SMALL LETTER ZE --> <!-- U+0437: "з" CYRILLIC SMALL LETTER ZE -->
@ -76,5 +76,5 @@
<!-- U+0445: "х" CYRILLIC SMALL LETTER HA --> <!-- U+0445: "х" CYRILLIC SMALL LETTER HA -->
<Key <Key
latin:keyLabel="&#x0445;" latin:keyLabel="&#x0445;"
latin:moreKeys="!label/more_keys_for_cyrillic_ha" /> latin:moreKeys="!text/more_keys_for_cyrillic_ha" />
</merge> </merge>

View File

@ -25,8 +25,8 @@
<Key <Key
latin:keyLabel="&#x0444;" /> latin:keyLabel="&#x0444;" />
<Key <Key
latin:keyLabel="!label/keylabel_for_east_slavic_row2_1" latin:keyLabel="!text/keylabel_for_east_slavic_row2_1"
latin:moreKeys="!label/more_keys_for_east_slavic_row2_1" /> latin:moreKeys="!text/more_keys_for_east_slavic_row2_1" />
<!-- U+0432: "в" CYRILLIC SMALL LETTER VE --> <!-- U+0432: "в" CYRILLIC SMALL LETTER VE -->
<Key <Key
latin:keyLabel="&#x0432;" /> latin:keyLabel="&#x0432;" />
@ -42,7 +42,7 @@
<!-- U+043E: "о" CYRILLIC SMALL LETTER O --> <!-- U+043E: "о" CYRILLIC SMALL LETTER O -->
<Key <Key
latin:keyLabel="&#x043E;" latin:keyLabel="&#x043E;"
latin:moreKeys="!label/more_keys_for_cyrillic_o" /> latin:moreKeys="!text/more_keys_for_cyrillic_o" />
<!-- U+043B: "л" CYRILLIC SMALL LETTER EL --> <!-- U+043B: "л" CYRILLIC SMALL LETTER EL -->
<Key <Key
latin:keyLabel="&#x043B;" /> latin:keyLabel="&#x043B;" />

View File

@ -34,14 +34,14 @@
<Key <Key
latin:keyLabel="&#x043C;" /> latin:keyLabel="&#x043C;" />
<Key <Key
latin:keyLabel="!label/keylabel_for_east_slavic_row3_5" /> latin:keyLabel="!text/keylabel_for_east_slavic_row3_5" />
<!-- U+0442: "т" CYRILLIC SMALL LETTER TE --> <!-- U+0442: "т" CYRILLIC SMALL LETTER TE -->
<Key <Key
latin:keyLabel="&#x0442;" /> latin:keyLabel="&#x0442;" />
<!-- U+044C: "ь" CYRILLIC SMALL LETTER SOFT SIGN --> <!-- U+044C: "ь" CYRILLIC SMALL LETTER SOFT SIGN -->
<Key <Key
latin:keyLabel="&#x044C;" latin:keyLabel="&#x044C;"
latin:moreKeys="!label/more_keys_for_cyrillic_soft_sign" /> latin:moreKeys="!text/more_keys_for_cyrillic_soft_sign" />
<!-- U+0431: "б" CYRILLIC SMALL LETTER BE --> <!-- U+0431: "б" CYRILLIC SMALL LETTER BE -->
<Key <Key
latin:keyLabel="&#x0431;" /> latin:keyLabel="&#x0431;" />

View File

@ -24,5 +24,5 @@
<include <include
latin:keyboardLayout="@xml/rowkeys_qwerty1" /> latin:keyboardLayout="@xml/rowkeys_qwerty1" />
<Key <Key
latin:keyLabel="!label/keylabel_for_nordic_row1_11" /> latin:keyLabel="!text/keylabel_for_nordic_row1_11" />
</merge> </merge>

View File

@ -24,9 +24,9 @@
<include <include
latin:keyboardLayout="@xml/rowkeys_qwerty2" /> latin:keyboardLayout="@xml/rowkeys_qwerty2" />
<Key <Key
latin:keyLabel="!label/keylabel_for_nordic_row2_10" latin:keyLabel="!text/keylabel_for_nordic_row2_10"
latin:moreKeys="!label/more_keys_for_nordic_row2_10" /> latin:moreKeys="!text/more_keys_for_nordic_row2_10" />
<Key <Key
latin:keyLabel="!label/keylabel_for_nordic_row2_11" latin:keyLabel="!text/keylabel_for_nordic_row2_11"
latin:moreKeys="!label/more_keys_for_nordic_row2_11" /> latin:moreKeys="!text/more_keys_for_nordic_row2_11" />
</merge> </merge>

View File

@ -29,42 +29,42 @@
latin:keyLabel="w" latin:keyLabel="w"
latin:keyHintLabel="2" latin:keyHintLabel="2"
latin:additionalMoreKeys="2" latin:additionalMoreKeys="2"
latin:moreKeys="!label/more_keys_for_w" /> latin:moreKeys="!text/more_keys_for_w" />
<Key <Key
latin:keyLabel="e" latin:keyLabel="e"
latin:keyHintLabel="3" latin:keyHintLabel="3"
latin:additionalMoreKeys="3" latin:additionalMoreKeys="3"
latin:moreKeys="!label/more_keys_for_e" /> latin:moreKeys="!text/more_keys_for_e" />
<Key <Key
latin:keyLabel="r" latin:keyLabel="r"
latin:keyHintLabel="4" latin:keyHintLabel="4"
latin:additionalMoreKeys="4" latin:additionalMoreKeys="4"
latin:moreKeys="!label/more_keys_for_r" /> latin:moreKeys="!text/more_keys_for_r" />
<Key <Key
latin:keyLabel="t" latin:keyLabel="t"
latin:keyHintLabel="5" latin:keyHintLabel="5"
latin:additionalMoreKeys="5" latin:additionalMoreKeys="5"
latin:moreKeys="!label/more_keys_for_t" /> latin:moreKeys="!text/more_keys_for_t" />
<Key <Key
latin:keyLabel="y" latin:keyLabel="y"
latin:keyHintLabel="6" latin:keyHintLabel="6"
latin:additionalMoreKeys="6" latin:additionalMoreKeys="6"
latin:moreKeys="!label/more_keys_for_y" /> latin:moreKeys="!text/more_keys_for_y" />
<Key <Key
latin:keyLabel="u" latin:keyLabel="u"
latin:keyHintLabel="7" latin:keyHintLabel="7"
latin:additionalMoreKeys="7" latin:additionalMoreKeys="7"
latin:moreKeys="!label/more_keys_for_u" /> latin:moreKeys="!text/more_keys_for_u" />
<Key <Key
latin:keyLabel="i" latin:keyLabel="i"
latin:keyHintLabel="8" latin:keyHintLabel="8"
latin:additionalMoreKeys="8" latin:additionalMoreKeys="8"
latin:moreKeys="!label/more_keys_for_i" /> latin:moreKeys="!text/more_keys_for_i" />
<Key <Key
latin:keyLabel="o" latin:keyLabel="o"
latin:keyHintLabel="9" latin:keyHintLabel="9"
latin:additionalMoreKeys="9" latin:additionalMoreKeys="9"
latin:moreKeys="!label/more_keys_for_o" /> latin:moreKeys="!text/more_keys_for_o" />
<Key <Key
latin:keyLabel="p" latin:keyLabel="p"
latin:keyHintLabel="0" latin:keyHintLabel="0"

View File

@ -23,28 +23,28 @@
> >
<Key <Key
latin:keyLabel="a" latin:keyLabel="a"
latin:moreKeys="!label/more_keys_for_a" /> latin:moreKeys="!text/more_keys_for_a" />
<Key <Key
latin:keyLabel="s" latin:keyLabel="s"
latin:moreKeys="!label/more_keys_for_s" /> latin:moreKeys="!text/more_keys_for_s" />
<Key <Key
latin:keyLabel="d" latin:keyLabel="d"
latin:moreKeys="!label/more_keys_for_d" /> latin:moreKeys="!text/more_keys_for_d" />
<Key <Key
latin:keyLabel="f" /> latin:keyLabel="f" />
<Key <Key
latin:keyLabel="g" latin:keyLabel="g"
latin:moreKeys="!label/more_keys_for_g" /> latin:moreKeys="!text/more_keys_for_g" />
<Key <Key
latin:keyLabel="h" latin:keyLabel="h"
latin:moreKeys="!label/more_keys_for_h" /> latin:moreKeys="!text/more_keys_for_h" />
<Key <Key
latin:keyLabel="j" latin:keyLabel="j"
latin:moreKeys="!label/more_keys_for_j" /> latin:moreKeys="!text/more_keys_for_j" />
<Key <Key
latin:keyLabel="k" latin:keyLabel="k"
latin:moreKeys="!label/more_keys_for_k" /> latin:moreKeys="!text/more_keys_for_k" />
<Key <Key
latin:keyLabel="l" latin:keyLabel="l"
latin:moreKeys="!label/more_keys_for_l" /> latin:moreKeys="!text/more_keys_for_l" />
</merge> </merge>

View File

@ -23,20 +23,20 @@
> >
<Key <Key
latin:keyLabel="z" latin:keyLabel="z"
latin:moreKeys="!label/more_keys_for_z" /> latin:moreKeys="!text/more_keys_for_z" />
<Key <Key
latin:keyLabel="x" /> latin:keyLabel="x" />
<Key <Key
latin:keyLabel="c" latin:keyLabel="c"
latin:moreKeys="!label/more_keys_for_c" /> latin:moreKeys="!text/more_keys_for_c" />
<Key <Key
latin:keyLabel="v" latin:keyLabel="v"
latin:moreKeys="!label/more_keys_for_v" /> latin:moreKeys="!text/more_keys_for_v" />
<Key <Key
latin:keyLabel="b" /> latin:keyLabel="b" />
<Key <Key
latin:keyLabel="n" latin:keyLabel="n"
latin:moreKeys="!label/more_keys_for_n" /> latin:moreKeys="!text/more_keys_for_n" />
<Key <Key
latin:keyLabel="m" /> latin:keyLabel="m" />
</merge> </merge>

View File

@ -29,42 +29,42 @@
latin:keyLabel="w" latin:keyLabel="w"
latin:keyHintLabel="2" latin:keyHintLabel="2"
latin:additionalMoreKeys="2" latin:additionalMoreKeys="2"
latin:moreKeys="!label/more_keys_for_w" /> latin:moreKeys="!text/more_keys_for_w" />
<Key <Key
latin:keyLabel="e" latin:keyLabel="e"
latin:keyHintLabel="3" latin:keyHintLabel="3"
latin:additionalMoreKeys="3" latin:additionalMoreKeys="3"
latin:moreKeys="!label/more_keys_for_e" /> latin:moreKeys="!text/more_keys_for_e" />
<Key <Key
latin:keyLabel="r" latin:keyLabel="r"
latin:keyHintLabel="4" latin:keyHintLabel="4"
latin:additionalMoreKeys="4" latin:additionalMoreKeys="4"
latin:moreKeys="!label/more_keys_for_r" /> latin:moreKeys="!text/more_keys_for_r" />
<Key <Key
latin:keyLabel="t" latin:keyLabel="t"
latin:keyHintLabel="5" latin:keyHintLabel="5"
latin:additionalMoreKeys="5" latin:additionalMoreKeys="5"
latin:moreKeys="!label/more_keys_for_t" /> latin:moreKeys="!text/more_keys_for_t" />
<Key <Key
latin:keyLabel="z" latin:keyLabel="z"
latin:keyHintLabel="6" latin:keyHintLabel="6"
latin:additionalMoreKeys="6" latin:additionalMoreKeys="6"
latin:moreKeys="!label/more_keys_for_z" /> latin:moreKeys="!text/more_keys_for_z" />
<Key <Key
latin:keyLabel="u" latin:keyLabel="u"
latin:keyHintLabel="7" latin:keyHintLabel="7"
latin:additionalMoreKeys="7" latin:additionalMoreKeys="7"
latin:moreKeys="!label/more_keys_for_u" /> latin:moreKeys="!text/more_keys_for_u" />
<Key <Key
latin:keyLabel="i" latin:keyLabel="i"
latin:keyHintLabel="8" latin:keyHintLabel="8"
latin:additionalMoreKeys="8" latin:additionalMoreKeys="8"
latin:moreKeys="!label/more_keys_for_i" /> latin:moreKeys="!text/more_keys_for_i" />
<Key <Key
latin:keyLabel="o" latin:keyLabel="o"
latin:keyHintLabel="9" latin:keyHintLabel="9"
latin:additionalMoreKeys="9" latin:additionalMoreKeys="9"
latin:moreKeys="!label/more_keys_for_o" /> latin:moreKeys="!text/more_keys_for_o" />
<Key <Key
latin:keyLabel="p" latin:keyLabel="p"
latin:keyHintLabel="0" latin:keyHintLabel="0"

View File

@ -23,20 +23,20 @@
> >
<Key <Key
latin:keyLabel="y" latin:keyLabel="y"
latin:moreKeys="!label/more_keys_for_y" /> latin:moreKeys="!text/more_keys_for_y" />
<Key <Key
latin:keyLabel="x" /> latin:keyLabel="x" />
<Key <Key
latin:keyLabel="c" latin:keyLabel="c"
latin:moreKeys="!label/more_keys_for_c" /> latin:moreKeys="!text/more_keys_for_c" />
<Key <Key
latin:keyLabel="v" latin:keyLabel="v"
latin:moreKeys="!label/more_keys_for_v" /> latin:moreKeys="!text/more_keys_for_v" />
<Key <Key
latin:keyLabel="b" /> latin:keyLabel="b" />
<Key <Key
latin:keyLabel="n" latin:keyLabel="n"
latin:moreKeys="!label/more_keys_for_n" /> latin:moreKeys="!text/more_keys_for_n" />
<Key <Key
latin:keyLabel="m" /> latin:keyLabel="m" />
</merge> </merge>

View File

@ -36,7 +36,7 @@
latin:keyLabel="&#x0435;" latin:keyLabel="&#x0435;"
latin:keyHintLabel="3" latin:keyHintLabel="3"
latin:additionalMoreKeys="3" latin:additionalMoreKeys="3"
latin:moreKeys="!label/more_keys_for_cyrillic_ie" /> latin:moreKeys="!text/more_keys_for_cyrillic_ie" />
<!-- U+0440: "р" CYRILLIC SMALL LETTER ER --> <!-- U+0440: "р" CYRILLIC SMALL LETTER ER -->
<Key <Key
latin:keyLabel="&#x0440;" latin:keyLabel="&#x0440;"
@ -48,7 +48,7 @@
latin:keyHintLabel="5" latin:keyHintLabel="5"
latin:additionalMoreKeys="5" /> latin:additionalMoreKeys="5" />
<Key <Key
latin:keyLabel="!label/keylabel_for_south_slavic_row1_6" latin:keyLabel="!text/keylabel_for_south_slavic_row1_6"
latin:keyHintLabel="6" latin:keyHintLabel="6"
latin:additionalMoreKeys="6" /> latin:additionalMoreKeys="6" />
<!-- U+0443: "у" CYRILLIC SMALL LETTER U --> <!-- U+0443: "у" CYRILLIC SMALL LETTER U -->
@ -61,7 +61,7 @@
latin:keyLabel="&#x0438;" latin:keyLabel="&#x0438;"
latin:keyHintLabel="8" latin:keyHintLabel="8"
latin:additionalMoreKeys="8" latin:additionalMoreKeys="8"
latin:moreKeys="!label/more_keys_for_cyrillic_i" /> latin:moreKeys="!text/more_keys_for_cyrillic_i" />
<!-- U+043E: "о" CYRILLIC SMALL LETTER O --> <!-- U+043E: "о" CYRILLIC SMALL LETTER O -->
<Key <Key
latin:keyLabel="&#x043E;" latin:keyLabel="&#x043E;"

View File

@ -52,5 +52,5 @@
<Key <Key
latin:keyLabel="&#x0447;" /> latin:keyLabel="&#x0447;" />
<Key <Key
latin:keyLabel="!label/keylabel_for_south_slavic_row2_11" /> latin:keyLabel="!text/keylabel_for_south_slavic_row2_11" />
</merge> </merge>

View File

@ -22,7 +22,7 @@
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
> >
<Key <Key
latin:keyLabel="!label/keylabel_for_south_slavic_row3_1" /> latin:keyLabel="!text/keylabel_for_south_slavic_row3_1" />
<!-- U+045F: "џ" CYRILLIC SMALL LETTER DZHE --> <!-- U+045F: "џ" CYRILLIC SMALL LETTER DZHE -->
<Key <Key
latin:keyLabel="&#x045F;" /> latin:keyLabel="&#x045F;" />
@ -42,7 +42,7 @@
<Key <Key
latin:keyLabel="&#x043C;" /> latin:keyLabel="&#x043C;" />
<Key <Key
latin:keyLabel="!label/keylabel_for_south_slavic_row3_8" /> latin:keyLabel="!text/keylabel_for_south_slavic_row3_8" />
<!-- U+0436: "ж" CYRILLIC SMALL LETTER ZHE --> <!-- U+0436: "ж" CYRILLIC SMALL LETTER ZHE -->
<Key <Key
latin:keyLabel="&#x0436;" /> latin:keyLabel="&#x0436;" />

View File

@ -22,43 +22,43 @@
xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin" xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
> >
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_1" latin:keyLabel="!text/keylabel_for_symbols_1"
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_1" latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_1"
latin:moreKeys="!label/more_keys_for_symbols_1" /> latin:moreKeys="!text/more_keys_for_symbols_1" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_2" latin:keyLabel="!text/keylabel_for_symbols_2"
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_2" latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_2"
latin:moreKeys="!label/more_keys_for_symbols_2" /> latin:moreKeys="!text/more_keys_for_symbols_2" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_3" latin:keyLabel="!text/keylabel_for_symbols_3"
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_3" latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_3"
latin:moreKeys="!label/more_keys_for_symbols_3" /> latin:moreKeys="!text/more_keys_for_symbols_3" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_4" latin:keyLabel="!text/keylabel_for_symbols_4"
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_4" latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_4"
latin:moreKeys="!label/more_keys_for_symbols_4" /> latin:moreKeys="!text/more_keys_for_symbols_4" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_5" latin:keyLabel="!text/keylabel_for_symbols_5"
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_5" latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_5"
latin:moreKeys="!label/more_keys_for_symbols_5" /> latin:moreKeys="!text/more_keys_for_symbols_5" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_6" latin:keyLabel="!text/keylabel_for_symbols_6"
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_6" latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_6"
latin:moreKeys="!label/more_keys_for_symbols_6" /> latin:moreKeys="!text/more_keys_for_symbols_6" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_7" latin:keyLabel="!text/keylabel_for_symbols_7"
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_7" latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_7"
latin:moreKeys="!label/more_keys_for_symbols_7" /> latin:moreKeys="!text/more_keys_for_symbols_7" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_8" latin:keyLabel="!text/keylabel_for_symbols_8"
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_8" latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_8"
latin:moreKeys="!label/more_keys_for_symbols_8" /> latin:moreKeys="!text/more_keys_for_symbols_8" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_9" latin:keyLabel="!text/keylabel_for_symbols_9"
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_9" latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_9"
latin:moreKeys="!label/more_keys_for_symbols_9" /> latin:moreKeys="!text/more_keys_for_symbols_9" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_0" latin:keyLabel="!text/keylabel_for_symbols_0"
latin:additionalMoreKeys="!label/additional_more_keys_for_symbols_0" latin:additionalMoreKeys="!text/additional_more_keys_for_symbols_0"
latin:moreKeys="!label/more_keys_for_symbols_0" /> latin:moreKeys="!text/more_keys_for_symbols_0" />
</merge> </merge>

View File

@ -28,13 +28,13 @@
<Key <Key
latin:keyStyle="currencyKeyStyle" /> latin:keyStyle="currencyKeyStyle" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_percent" latin:keyLabel="!text/keylabel_for_symbols_percent"
latin:moreKeys="!label/more_keys_for_symbols_percent" /> latin:moreKeys="!text/more_keys_for_symbols_percent" />
<Key <Key
latin:keyLabel="&amp;" /> latin:keyLabel="&amp;" />
<Key <Key
latin:keyLabel="*" latin:keyLabel="*"
latin:moreKeys="!label/more_keys_for_star" /> latin:moreKeys="!text/more_keys_for_star" />
<!-- U+2013: "" EN DASH <!-- U+2013: "" EN DASH
U+2014: "—" EM DASH --> U+2014: "—" EM DASH -->
<Key <Key
@ -42,7 +42,7 @@
latin:moreKeys="_,&#x2013;,&#x2014;" /> latin:moreKeys="_,&#x2013;,&#x2014;" />
<Key <Key
latin:keyLabel="+" latin:keyLabel="+"
latin:moreKeys="!label/more_keys_for_plus" /> latin:moreKeys="!text/more_keys_for_plus" />
<include <include
latin:keyboardLayout="@xml/keys_parentheses" /> latin:keyboardLayout="@xml/keys_parentheses" />
</merge> </merge>

View File

@ -31,20 +31,20 @@
latin:moreKeys="&#x00A1;" /> latin:moreKeys="&#x00A1;" />
<Key <Key
latin:keyLabel="&quot;" latin:keyLabel="&quot;"
latin:moreKeys="!label/more_keys_for_double_quote" /> latin:moreKeys="!text/more_keys_for_double_quote" />
<Key <Key
latin:keyLabel="\'" latin:keyLabel="\'"
latin:moreKeys="!label/more_keys_for_single_quote" /> latin:moreKeys="!text/more_keys_for_single_quote" />
<Key <Key
latin:keyLabel=":" /> latin:keyLabel=":" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_semicolon" latin:keyLabel="!text/keylabel_for_symbols_semicolon"
latin:moreKeys="!label/more_keys_for_symbols_semicolon" /> latin:moreKeys="!text/more_keys_for_symbols_semicolon" />
<Key <Key
latin:keyLabel="/" /> latin:keyLabel="/" />
<Key <Key
latin:keyLabel="!label/keylabel_for_symbols_question" latin:keyLabel="!text/keylabel_for_symbols_question"
latin:moreKeys="!label/more_keys_for_symbols_question" /> latin:moreKeys="!text/more_keys_for_symbols_question" />
<Key <Key
latin:keyStyle="deleteKeyStyle" latin:keyStyle="deleteKeyStyle"
latin:keyWidth="fillRight" latin:keyWidth="fillRight"

View File

@ -30,7 +30,7 @@
<!-- U+2022: "•" BULLET --> <!-- U+2022: "•" BULLET -->
<Key <Key
latin:keyLabel="&#x2022;" latin:keyLabel="&#x2022;"
latin:moreKeys="!label/more_keys_for_bullet" /> latin:moreKeys="!text/more_keys_for_bullet" />
<!-- U+221A: "√" SQUARE ROOT --> <!-- U+221A: "√" SQUARE ROOT -->
<Key <Key
latin:keyLabel="&#x221A;" /> latin:keyLabel="&#x221A;" />

View File

@ -61,7 +61,7 @@
<Key <Key
latin:keyLabel="." latin:keyLabel="."
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:moreKeys="!label/more_keys_for_am_pm" latin:moreKeys="!text/more_keys_for_am_pm"
latin:keyStyle="numFunctionalKeyStyle" latin:keyStyle="numFunctionalKeyStyle"
latin:keyWidth="fillRight" /> latin:keyWidth="fillRight" />
</case> </case>

View File

@ -37,9 +37,9 @@
<!-- latin:hasShortcutKey="false" --> <!-- latin:hasShortcutKey="false" -->
<default> <default>
<Key <Key
latin:keyLabel="!label/keylabel_for_comma" latin:keyLabel="!text/keylabel_for_comma"
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:additionalMoreKeys="!label/more_keys_for_comma" latin:additionalMoreKeys="!text/more_keys_for_comma"
latin:keyStyle="f1MoreKeysStyle" /> latin:keyStyle="f1MoreKeysStyle" />
</default> </default>
</switch> </switch>

View File

@ -30,7 +30,7 @@ import android.view.InflateException;
import com.android.inputmethod.keyboard.internal.KeyStyles; import com.android.inputmethod.keyboard.internal.KeyStyles;
import com.android.inputmethod.keyboard.internal.KeyboardCodesSet; import com.android.inputmethod.keyboard.internal.KeyboardCodesSet;
import com.android.inputmethod.keyboard.internal.KeyboardIconsSet; 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.LatinImeLogger;
import com.android.inputmethod.latin.LocaleUtils.RunInLocale; import com.android.inputmethod.latin.LocaleUtils.RunInLocale;
import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.R;
@ -236,8 +236,8 @@ public class Keyboard {
public final ArrayList<Key> mAltCodeKeysWhileTyping = new ArrayList<Key>(); public final ArrayList<Key> mAltCodeKeysWhileTyping = new ArrayList<Key>();
public final KeyboardIconsSet mIconsSet = new KeyboardIconsSet(); public final KeyboardIconsSet mIconsSet = new KeyboardIconsSet();
public final KeyboardCodesSet mCodesSet = new KeyboardCodesSet(); public final KeyboardCodesSet mCodesSet = new KeyboardCodesSet();
public final KeyboardLabelsSet mLabelsSet = new KeyboardLabelsSet(); public final KeyboardTextsSet mTextsSet = new KeyboardTextsSet();
public final KeyStyles mKeyStyles = new KeyStyles(mLabelsSet); public final KeyStyles mKeyStyles = new KeyStyles(mTextsSet);
public KeyboardLayoutSet.KeysCache mKeysCache; public KeyboardLayoutSet.KeysCache mKeysCache;
@ -776,11 +776,11 @@ public class Keyboard {
params.mIconsSet.loadIcons(keyboardAttr); params.mIconsSet.loadIcons(keyboardAttr);
final String language = params.mId.mLocale.getLanguage(); final String language = params.mId.mLocale.getLanguage();
params.mCodesSet.setLanguage(language); params.mCodesSet.setLanguage(language);
params.mLabelsSet.setLanguage(language); params.mTextsSet.setLanguage(language);
final RunInLocale<Void> job = new RunInLocale<Void>() { final RunInLocale<Void> job = new RunInLocale<Void>() {
@Override @Override
protected Void job(Resources res) { protected Void job(Resources res) {
params.mLabelsSet.loadStringResources(mContext); params.mTextsSet.loadStringResources(mContext);
return null; return null;
} }
}; };

View File

@ -30,8 +30,8 @@ import java.util.Arrays;
* The specification is comma separated texts each of which represents one "more key". * 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 * The specification might have label or string resource reference in it. These references are
* expanded before parsing comma. * expanded before parsing comma.
* - Label reference should be a string representation of label (!label/label_name) * - Label reference should be a string representation of label (!text/label_name)
* - String resource reference should be a string representation of resource (!label/resource_name) * - String resource reference should be a string representation of resource (!text/resource_name)
* Each "more key" specification is one of the following: * Each "more key" specification is one of the following:
* - Label optionally followed by keyOutputText or code (keyLabel|keyOutputText). * - Label optionally followed by keyOutputText or code (keyLabel|keyOutputText).
* - Icon followed by keyOutputText or code (!icon/icon_name|!code/code_name) * - 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 int COMMA = ',';
private static final char ESCAPE_CHAR = '\\'; private static final char ESCAPE_CHAR = '\\';
private static final char LABEL_END = '|'; 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_ICON = "!icon/";
private static final String PREFIX_CODE = "!code/"; private static final String PREFIX_CODE = "!code/";
private static final String PREFIX_HEX = "0x"; 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; int level = 0;
String text = rawText; String text = rawText;
StringBuilder sb; StringBuilder sb;
@ -344,7 +344,7 @@ public class KeySpecParser {
throw new RuntimeException("too many @string/resource indirection: " + text); 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(); final int size = text.length();
if (size < prefixLen) { if (size < prefixLen) {
return text; return text;
@ -353,14 +353,14 @@ public class KeySpecParser {
sb = null; sb = null;
for (int pos = 0; pos < size; pos++) { for (int pos = 0; pos < size; pos++) {
final char c = text.charAt(pos); final char c = text.charAt(pos);
if (text.regionMatches(true, pos, PREFIX_LABEL, 0, prefixLen) if (text.regionMatches(true, pos, PREFIX_TEXT, 0, prefixLen)
&& labelsSet != null) { && textsSet != null) {
if (sb == null) { if (sb == null) {
sb = new StringBuilder(text.substring(0, pos)); 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); final String name = text.substring(pos + prefixLen, end);
sb.append(labelsSet.getLabel(name)); sb.append(textsSet.getText(name));
pos = end - 1; pos = end - 1;
} else if (c == ESCAPE_CHAR) { } else if (c == ESCAPE_CHAR) {
if (sb != null) { if (sb != null) {
@ -381,7 +381,7 @@ public class KeySpecParser {
return text; return text;
} }
private static int searchLabelNameEnd(String text, int start) { private static int searchTextNameEnd(String text, int start) {
final int size = text.length(); final int size = text.length();
for (int pos = start; pos < size; pos++) { for (int pos = start; pos < size; pos++) {
final char c = text.charAt(pos); final char c = text.charAt(pos);
@ -395,8 +395,8 @@ public class KeySpecParser {
return size; return size;
} }
public static String[] parseCsvString(String rawText, KeyboardLabelsSet labelsSet) { public static String[] parseCsvString(String rawText, KeyboardTextsSet textsSet) {
final String text = resolveLabelReference(rawText, labelsSet); final String text = resolveTextReference(rawText, textsSet);
final int size = text.length(); final int size = text.length();
if (size == 0) { if (size == 0) {
return null; return null;

View File

@ -35,19 +35,19 @@ public class KeyStyles {
private final HashMap<String, DeclaredKeyStyle> mStyles = private final HashMap<String, DeclaredKeyStyle> mStyles =
new HashMap<String, DeclaredKeyStyle>(); new HashMap<String, DeclaredKeyStyle>();
private final KeyboardLabelsSet mLabelsSet; private final KeyboardTextsSet mTextsSet;
private final KeyStyle mEmptyKeyStyle; private final KeyStyle mEmptyKeyStyle;
public KeyStyles(KeyboardLabelsSet labelsSet) { public KeyStyles(KeyboardTextsSet textsSet) {
mLabelsSet = labelsSet; mTextsSet = textsSet;
mEmptyKeyStyle = new EmptyKeyStyle(labelsSet); mEmptyKeyStyle = new EmptyKeyStyle(textsSet);
} }
public static abstract class KeyStyle { public static abstract class KeyStyle {
protected final KeyboardLabelsSet mLabelsSet; protected final KeyboardTextsSet mTextsSet;
public KeyStyle(KeyboardLabelsSet labelsSet) { public KeyStyle(KeyboardTextsSet textsSet) {
mLabelsSet = labelsSet; mTextsSet = textsSet;
} }
public abstract String[] getStringArray(TypedArray a, int index); public abstract String[] getStringArray(TypedArray a, int index);
@ -57,22 +57,22 @@ public class KeyStyles {
protected String parseString(TypedArray a, int index) { protected String parseString(TypedArray a, int index) {
if (a.hasValue(index)) { if (a.hasValue(index)) {
return KeySpecParser.resolveLabelReference(a.getString(index), mLabelsSet); return KeySpecParser.resolveTextReference(a.getString(index), mTextsSet);
} }
return null; return null;
} }
protected String[] parseStringArray(TypedArray a, int index) { protected String[] parseStringArray(TypedArray a, int index) {
if (a.hasValue(index)) { if (a.hasValue(index)) {
return KeySpecParser.parseCsvString(a.getString(index), mLabelsSet); return KeySpecParser.parseCsvString(a.getString(index), mTextsSet);
} }
return null; return null;
} }
} }
private static class EmptyKeyStyle extends KeyStyle { private static class EmptyKeyStyle extends KeyStyle {
public EmptyKeyStyle(KeyboardLabelsSet labelsSet) { public EmptyKeyStyle(KeyboardTextsSet textsSet) {
super(labelsSet); super(textsSet);
} }
@Override @Override
@ -99,8 +99,8 @@ public class KeyStyles {
private static class DeclaredKeyStyle extends KeyStyle { private static class DeclaredKeyStyle extends KeyStyle {
private final HashMap<Integer, Object> mStyleAttributes = new HashMap<Integer, Object>(); private final HashMap<Integer, Object> mStyleAttributes = new HashMap<Integer, Object>();
public DeclaredKeyStyle(KeyboardLabelsSet labelsSet) { public DeclaredKeyStyle(KeyboardTextsSet textsSet) {
super(labelsSet); super(textsSet);
} }
@Override @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)) { if (keyStyleAttr.hasValue(R.styleable.Keyboard_KeyStyle_parentStyle)) {
final String parentStyle = keyStyleAttr.getString( final String parentStyle = keyStyleAttr.getString(
R.styleable.Keyboard_KeyStyle_parentStyle); R.styleable.Keyboard_KeyStyle_parentStyle);

View File

@ -25,23 +25,23 @@ import java.util.HashMap;
/** /**
* !!!!! DO NOT EDIT THIS FILE !!!!! * !!!!! DO NOT EDIT THIS FILE !!!!!
* This file is generated by tools/makelabel. * This file is generated by tools/maketext.
*/ */
public final class KeyboardLabelsSet { public final class KeyboardTextsSet {
// Language to labels map. // Language to texts map.
private static final HashMap<String, String[]> sLocaleToLabelsMap = private static final HashMap<String, String[]> sLocaleToTextsMap =
new HashMap<String, String[]>(); new HashMap<String, String[]>();
private static final HashMap<String, Integer> sLowerCaseNameToIdsMap = private static final HashMap<String, Integer> sLowerCaseNameToIdsMap =
new HashMap<String, Integer>(); new HashMap<String, Integer>();
private String[] mLabels; private String[] mTexts;
// Resource name to label map. // Resource name to text map.
private HashMap<String, String> mResourceNameToLabelsMap = new HashMap<String, String>(); private HashMap<String, String> mResourceNameToTextsMap = new HashMap<String, String>();
public void setLanguage(final String language) { public void setLanguage(final String language) {
mLabels = sLocaleToLabelsMap.get(language); mTexts = sLocaleToTextsMap.get(language);
if (mLabels == null) { if (mTexts == null) {
mLabels = LANGUAGE_DEFAULT; mTexts = LANGUAGE_DEFAULT;
} }
} }
@ -56,31 +56,31 @@ public final class KeyboardLabelsSet {
final String packageName = res.getResourcePackageName(referenceId); final String packageName = res.getResourcePackageName(referenceId);
for (final String resName : resourceNames) { for (final String resName : resourceNames) {
final int resId = res.getIdentifier(resName, "string", packageName); 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 lowerCaseName = null;
String label = mResourceNameToLabelsMap.get(name); String text = mResourceNameToTextsMap.get(name);
if (label == null) { if (text == null) {
lowerCaseName = name.toLowerCase(); lowerCaseName = name.toLowerCase();
label = mResourceNameToLabelsMap.get(lowerCaseName); text = mResourceNameToTextsMap.get(lowerCaseName);
} }
if (label != null) { if (text != null) {
return label; return text;
} }
Integer id = sLowerCaseNameToIdsMap.get(name); Integer id = sLowerCaseNameToIdsMap.get(name);
if (id == null) { if (id == null) {
id = sLowerCaseNameToIdsMap.get(lowerCaseName); // lowerCaseName != null id = sLowerCaseNameToIdsMap.get(lowerCaseName); // lowerCaseName != null
} }
if (id == null) throw new RuntimeException("Unknown label: " + name); if (id == null) throw new RuntimeException("Unknown label: " + name);
label = (id < mLabels.length) ? mLabels[id] : null; text = (id < mTexts.length) ? mTexts[id] : null;
return (label == null) ? LANGUAGE_DEFAULT[id] : label; return (text == null) ? LANGUAGE_DEFAULT[id] : text;
} }
private static final String[] RESOURCE_NAMES = { private static final String[] RESOURCE_NAMES = {
// These labels' name should be aligned with the @string/<name> in values/strings.xml. // These texts' name should be aligned with the @string/<name> in values/strings.xml.
// Labels for action. // Labels for action.
"label_go_key", "label_go_key",
// "label_search_key", // "label_search_key",
@ -222,7 +222,7 @@ public final class KeyboardLabelsSet {
private static final String EMPTY = ""; private static final String EMPTY = "";
/* Default labels */ /* Default texts */
private static final String[] LANGUAGE_DEFAULT = { private static final String[] LANGUAGE_DEFAULT = {
/* 0~ */ /* 0~ */
EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 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+2666: "♦" BLACK DIAMOND SUIT
// U+2663: "♣" BLACK CLUB SUIT // U+2663: "♣" BLACK CLUB SUIT
/* 108 */ "\u266A,\u2665,\u2660,\u2666,\u2663", /* 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", /* 110 */ "!icon/settings_key|!code/key_settings",
/* 111 */ "!icon/shortcut_key|!code/key_shortcut", /* 111 */ "!icon/shortcut_key|!code/key_shortcut",
/* 112 */ "!hasLabels!,!label/label_next_key|!code/key_action_next", /* 112 */ "!hasLabels!,!text/label_next_key|!code/key_action_next",
/* 113 */ "!hasLabels!,!label/label_previous_key|!code/key_action_previous", /* 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! // Label for "switch to more symbol" modifier key. Must be short to fit on key!
/* 114 */ "= \\ <", /* 114 */ "= \\ <",
// Label for "switch to more symbol" modifier key on tablets. Must be short to fit on key! // 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", /* 19 */ "\u0175",
}; };
private static final Object[] LANGUAGES_AND_LABELS = { private static final Object[] LANGUAGES_AND_TEXTS = {
"DEFAULT", LANGUAGE_DEFAULT, /* default */ "DEFAULT", LANGUAGE_DEFAULT, /* default */
"ar", LANGUAGE_ar, /* Arabic */ "ar", LANGUAGE_ar, /* Arabic */
"be", LANGUAGE_be, /* Belarusian */ "be", LANGUAGE_be, /* Belarusian */
@ -2505,10 +2505,10 @@ public final class KeyboardLabelsSet {
sLowerCaseNameToIdsMap.put(name, id++); sLowerCaseNameToIdsMap.put(name, id++);
} }
for (int i = 0; i < LANGUAGES_AND_LABELS.length; i += 2) { for (int i = 0; i < LANGUAGES_AND_TEXTS.length; i += 2) {
final String language = (String)LANGUAGES_AND_LABELS[i]; final String language = (String)LANGUAGES_AND_TEXTS[i];
final String[] labels = (String[])LANGUAGES_AND_LABELS[i + 1]; final String[] texts = (String[])LANGUAGES_AND_TEXTS[i + 1];
sLocaleToLabelsMap.put(language, labels); sLocaleToTextsMap.put(language, texts);
} }
} }
} }

View File

@ -50,13 +50,13 @@
<string name="multiple_labels_with_escape_surrounded_by_spaces">" \\abc , d\\ef , gh\\i "</string> <string name="multiple_labels_with_escape_surrounded_by_spaces">" \\abc , d\\ef , gh\\i "</string>
<string name="multiple_labels_with_comma_and_escape">"ab\\\\,d\\\\\\,,g\\,i"</string> <string name="multiple_labels_with_comma_and_escape">"ab\\\\,d\\\\\\,,g\\,i"</string>
<string name="multiple_labels_with_comma_and_escape_surrounded_by_spaces">" ab\\\\ , d\\\\\\, , g\\,i "</string> <string name="multiple_labels_with_comma_and_escape_surrounded_by_spaces">" ab\\\\ , d\\\\\\, , g\\,i "</string>
<string name="indirect_string">!label/multiple_chars</string> <string name="indirect_string">!text/multiple_chars</string>
<string name="indirect_string_with_literal">x,!label/multiple_chars,y</string> <string name="indirect_string_with_literal">x,!text/multiple_chars,y</string>
<string name="indirect2_string">!label/indirect_string</string> <string name="indirect2_string">!text/indirect_string</string>
<string name="infinite_indirection">infinite,!label/infinite_indirection,loop</string> <string name="infinite_indirection">infinite,!text/infinite_indirection,loop</string>
<string name="upper_indirect_string">!LABEL/MULTIPLE_CHARS</string> <string name="upper_indirect_string">!TEXT/MULTIPLE_CHARS</string>
<string name="upper_indirect_string_with_literal">x,!LABEL/MULTIPLE_CHARS,y</string> <string name="upper_indirect_string_with_literal">x,!TEXT/MULTIPLE_CHARS,y</string>
<string name="upper_indirect2_string">!LABEL/UPPER_INDIRECT_STRING</string> <string name="upper_indirect2_string">!TEXT/UPPER_INDIRECT_STRING</string>
<string name="upper_infinite_indirection">infinite,!LABEL/INFINITE_INDIRECTION,loop</string> <string name="upper_infinite_indirection">infinite,!TEXT/INFINITE_INDIRECTION,loop</string>
<string name="indirect_navigate_actions_as_more_key">!fixedColumnOrder!2,!label/action_previous_as_more_key,!label/action_next_as_more_key</string> <string name="indirect_navigate_actions_as_more_key">!fixedColumnOrder!2,!text/action_previous_as_more_key,!text/action_next_as_more_key</string>
</resources> </resources>

View File

@ -24,17 +24,17 @@ import java.util.Arrays;
import java.util.Locale; import java.util.Locale;
public class KeySpecParserCsvTests extends AndroidTestCase { public class KeySpecParserCsvTests extends AndroidTestCase {
private final KeyboardLabelsSet mLabelsSet = new KeyboardLabelsSet(); private final KeyboardTextsSet mTextsSet = new KeyboardTextsSet();
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
mLabelsSet.setLanguage(Locale.ENGLISH.getLanguage()); mTextsSet.setLanguage(Locale.ENGLISH.getLanguage());
mLabelsSet.loadStringResources(getContext()); mTextsSet.loadStringResources(getContext());
final String[] testResourceNames = getAllResourceIdNames( final String[] testResourceNames = getAllResourceIdNames(
com.android.inputmethod.latin.tests.R.string.class); com.android.inputmethod.latin.tests.R.string.class);
mLabelsSet.loadStringResourcesInternal(getTestContext(), mTextsSet.loadStringResourcesInternal(getTestContext(),
testResourceNames, testResourceNames,
com.android.inputmethod.latin.tests.R.string.empty_string); 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) { 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; final String[] expected = (expectedArray.length == 0) ? null : expectedArray;
assertArrayEquals(message, expected, actual); assertArrayEquals(message, expected, actual);
} }
@ -122,10 +122,10 @@ public class KeySpecParserCsvTests extends AndroidTestCase {
"ab" + SURROGATE1 + "cd", "ab" + SURROGATE1 + "cd",
"ab" + SURROGATE1 + "cd"); "ab" + SURROGATE1 + "cd");
assertTextArray("Incomplete resource reference 1", "label", "label"); assertTextArray("Incomplete resource reference 1", "text", "text");
assertTextArray("Incomplete resource reference 2", "!label", "!label"); assertTextArray("Incomplete resource reference 2", "!text", "!text");
assertTextArray("Incomplete RESOURCE REFERENCE 2", "!LABEL", "!LABEL"); assertTextArray("Incomplete RESOURCE REFERENCE 2", "!TEXT", "!TEXT");
assertTextArray("Incomplete resource reference 3", "label/", "label/"); assertTextArray("Incomplete resource reference 3", "text/", "text/");
assertTextArray("Incomplete resource reference 4", "!" + SURROGATE2, "!" + SURROGATE2); assertTextArray("Incomplete resource reference 4", "!" + SURROGATE2, "!" + SURROGATE2);
} }
@ -157,11 +157,11 @@ public class KeySpecParserCsvTests extends AndroidTestCase {
assertTextArray("Escaped surrogate with escape", assertTextArray("Escaped surrogate with escape",
PAIR1 + "\\\\" + PAIR2, PAIR1 + "\\\\" + PAIR2); PAIR1 + "\\\\" + PAIR2, PAIR1 + "\\\\" + PAIR2);
assertTextArray("Escaped !label", "\\!label", "\\!label"); assertTextArray("Escaped !text", "\\!text", "\\!text");
assertTextArray("Escaped !label/", "\\!label/", "\\!label/"); assertTextArray("Escaped !text/", "\\!text/", "\\!text/");
assertTextArray("Escaped !LABEL/", "\\!LABEL/", "\\!LABEL/"); assertTextArray("Escaped !TEXT/", "\\!TEXT/", "\\!TEXT/");
assertTextArray("Escaped !label/name", "\\!label/empty_string", "\\!label/empty_string"); assertTextArray("Escaped !text/name", "\\!text/empty_string", "\\!text/empty_string");
assertTextArray("Escaped !LABEL/NAME", "\\!LABEL/EMPTY_STRING", "\\!LABEL/EMPTY_STRING"); assertTextArray("Escaped !TEXT/NAME", "\\!TEXT/EMPTY_STRING", "\\!TEXT/EMPTY_STRING");
} }
public void testParseCsvTextMulti() { public void testParseCsvTextMulti() {
@ -192,204 +192,204 @@ public class KeySpecParserCsvTests extends AndroidTestCase {
assertTextArray("Multiple labels with comma and escape surrounded by spaces", assertTextArray("Multiple labels with comma and escape surrounded by spaces",
" ab\\\\ , d\\\\\\, , g\\,i ", " ab\\\\ ", " d\\\\\\, ", " g\\,i "); " ab\\\\ , d\\\\\\, , g\\,i ", " ab\\\\ ", " d\\\\\\, ", " g\\,i ");
assertTextArray("Multiple escaped !label", "\\!,\\!label/empty_string", assertTextArray("Multiple escaped !text", "\\!,\\!text/empty_string",
"\\!", "\\!label/empty_string"); "\\!", "\\!text/empty_string");
assertTextArray("Multiple escaped !LABEL", "\\!,\\!LABEL/EMPTY_STRING", assertTextArray("Multiple escaped !TEXT", "\\!,\\!TEXT/EMPTY_STRING",
"\\!", "\\!LABEL/EMPTY_STRING"); "\\!", "\\!TEXT/EMPTY_STRING");
} }
public void testParseCsvResourceError() { public void testParseCsvResourceError() {
assertError("Incomplete resource name", "!label/", "!label/"); assertError("Incomplete resource name", "!text/", "!text/");
assertError("Non existing resource", "!label/non_existing"); assertError("Non existing resource", "!text/non_existing");
} }
public void testParseCsvResourceZero() { public void testParseCsvResourceZero() {
assertTextArray("Empty string", assertTextArray("Empty string",
"!label/empty_string"); "!text/empty_string");
assertTextArray("EMPTY STRING", assertTextArray("EMPTY STRING",
"!LABEL/EMPTY_STRING"); "!TEXT/EMPTY_STRING");
} }
public void testParseCsvResourceSingle() { public void testParseCsvResourceSingle() {
assertTextArray("Single char", assertTextArray("Single char",
"!label/single_char", "a"); "!text/single_char", "a");
assertTextArray("SINGLE CHAR", assertTextArray("SINGLE CHAR",
"!LABEL/SINGLE_CHAR", "a"); "!TEXT/SINGLE_CHAR", "a");
assertTextArray("Space", assertTextArray("Space",
"!label/space", " "); "!text/space", " ");
assertTextArray("Single label", assertTextArray("Single label",
"!label/single_label", "abc"); "!text/single_label", "abc");
assertTextArray("Spaces", assertTextArray("Spaces",
"!label/spaces", " "); "!text/spaces", " ");
assertTextArray("Spaces in label", assertTextArray("Spaces in label",
"!label/spaces_in_label", "a b c"); "!text/spaces_in_label", "a b c");
assertTextArray("Spaces at beginning of label", 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", 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", assertTextArray("label surrounded by spaces",
"!label/label_surrounded_by_spaces", " abc "); "!text/label_surrounded_by_spaces", " abc ");
assertTextArray("Escape and single char", assertTextArray("Escape and single char",
"\\\\!label/single_char", "\\\\a"); "\\\\!text/single_char", "\\\\a");
assertTextArray("Escape and SINGLE CHAR", assertTextArray("Escape and SINGLE CHAR",
"\\\\!LABEL/SINGLE_CHAR", "\\\\a"); "\\\\!TEXT/SINGLE_CHAR", "\\\\a");
} }
public void testParseCsvResourceSingleEscaped() { public void testParseCsvResourceSingleEscaped() {
assertTextArray("Escaped char", assertTextArray("Escaped char",
"!label/escaped_char", "\\a"); "!text/escaped_char", "\\a");
assertTextArray("Escaped comma", assertTextArray("Escaped comma",
"!label/escaped_comma", "\\,"); "!text/escaped_comma", "\\,");
assertTextArray("Escaped comma escape", assertTextArray("Escaped comma escape",
"!label/escaped_comma_escape", "a\\,\\"); "!text/escaped_comma_escape", "a\\,\\");
assertTextArray("Escaped escape", assertTextArray("Escaped escape",
"!label/escaped_escape", "\\\\"); "!text/escaped_escape", "\\\\");
assertTextArray("Escaped label", assertTextArray("Escaped label",
"!label/escaped_label", "a\\bc"); "!text/escaped_label", "a\\bc");
assertTextArray("Escaped label at beginning", assertTextArray("Escaped label at beginning",
"!label/escaped_label_at_beginning", "\\abc"); "!text/escaped_label_at_beginning", "\\abc");
assertTextArray("Escaped label at end", assertTextArray("Escaped label at end",
"!label/escaped_label_at_end", "abc\\"); "!text/escaped_label_at_end", "abc\\");
assertTextArray("Escaped label with comma", 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", 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", 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", assertTextArray("Escaped label with successive",
"!label/escaped_label_with_successive", "\\,\\\\bc"); "!text/escaped_label_with_successive", "\\,\\\\bc");
assertTextArray("Escaped label with escape", assertTextArray("Escaped label with escape",
"!label/escaped_label_with_escape", "a\\\\c"); "!text/escaped_label_with_escape", "a\\\\c");
} }
public void testParseCsvResourceMulti() { public void testParseCsvResourceMulti() {
assertTextArray("Multiple chars", assertTextArray("Multiple chars",
"!label/multiple_chars", "a", "b", "c"); "!text/multiple_chars", "a", "b", "c");
assertTextArray("MULTIPLE CHARS", assertTextArray("MULTIPLE CHARS",
"!LABEL/MULTIPLE_CHARS", "a", "b", "c"); "!TEXT/MULTIPLE_CHARS", "a", "b", "c");
assertTextArray("Multiple chars surrounded by spaces", assertTextArray("Multiple chars surrounded by spaces",
"!label/multiple_chars_surrounded_by_spaces", "!text/multiple_chars_surrounded_by_spaces",
" a ", " b ", " c "); " a ", " b ", " c ");
assertTextArray("Multiple labels", assertTextArray("Multiple labels",
"!label/multiple_labels", "abc", "def", "ghi"); "!text/multiple_labels", "abc", "def", "ghi");
assertTextArray("Multiple labels surrounded by spaces", 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() { public void testParseCsvResourcetMultiEscaped() {
assertTextArray("Multiple chars with comma", assertTextArray("Multiple chars with comma",
"!label/multiple_chars_with_comma", "!text/multiple_chars_with_comma",
"a", "\\,", "c"); "a", "\\,", "c");
assertTextArray("Multiple chars with comma surrounded by spaces", 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 "); " a ", " \\, ", " c ");
assertTextArray("Multiple labels with escape", assertTextArray("Multiple labels with escape",
"!label/multiple_labels_with_escape", "!text/multiple_labels_with_escape",
"\\abc", "d\\ef", "gh\\i"); "\\abc", "d\\ef", "gh\\i");
assertTextArray("Multiple labels with escape surrounded by spaces", 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 "); " \\abc ", " d\\ef ", " gh\\i ");
assertTextArray("Multiple labels with comma and escape", 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"); "ab\\\\", "d\\\\\\,", "g\\,i");
assertTextArray("Multiple labels with comma and escape surrounded by spaces", 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 "); " ab\\\\ ", " d\\\\\\, ", " g\\,i ");
} }
public void testParseMultipleResources() { public void testParseMultipleResources() {
assertTextArray("Literals and resources", 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", 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", 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", 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", "\\,"); "a", "abc", "\\,");
assertTextArray("Multiple single resource chars and labels 2", 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\\,\\"); "a", "abc", "a\\,\\");
assertTextArray("Multiple single RESOURCE chars and LABELS 2", 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\\,\\"); "a", "abc", "a\\,\\");
assertTextArray("Multiple multiple resource chars and labels", 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"); "a", "b", "c", "abc", "def", "ghi", "a", "\\,", "c");
assertTextArray("Concatenated resources", 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"); "a", "b", "cabc", "def", "ghia", "\\,", "c");
assertTextArray("Concatenated resource and literal", assertTextArray("Concatenated resource and literal",
"abc!label/multiple_labels", "abc!text/multiple_labels",
"abcabc", "def", "ghi"); "abcabc", "def", "ghi");
} }
public void testParseIndirectReference() { public void testParseIndirectReference() {
assertTextArray("Indirect", assertTextArray("Indirect",
"!label/indirect_string", "a", "b", "c"); "!text/indirect_string", "a", "b", "c");
assertTextArray("Indirect with literal", 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", assertTextArray("Indirect2",
"!label/indirect2_string", "a", "b", "c"); "!text/indirect2_string", "a", "b", "c");
assertTextArray("INDIRECT", assertTextArray("INDIRECT",
"!LABEL/INDIRECT_STRING", "a", "b", "c"); "!TEXT/INDIRECT_STRING", "a", "b", "c");
assertTextArray("INDIRECT with literal", 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", assertTextArray("INDIRECT2",
"!LABEL/INDIRECT2_STRING", "a", "b", "c"); "!TEXT/INDIRECT2_STRING", "a", "b", "c");
assertTextArray("Upper indirect", assertTextArray("Upper indirect",
"!label/upper_indirect_string", "a", "b", "c"); "!text/upper_indirect_string", "a", "b", "c");
assertTextArray("Upper indirect with literal", 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", assertTextArray("Upper indirect2",
"!label/upper_indirect2_string", "a", "b", "c"); "!text/upper_indirect2_string", "a", "b", "c");
assertTextArray("UPPER INDIRECT", assertTextArray("UPPER INDIRECT",
"!LABEL/upper_INDIRECT_STRING", "a", "b", "c"); "!TEXT/upper_INDIRECT_STRING", "a", "b", "c");
assertTextArray("Upper INDIRECT with literal", 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", assertTextArray("Upper INDIRECT2",
"!LABEL/upper_INDIRECT2_STRING", "a", "b", "c"); "!TEXT/upper_INDIRECT2_STRING", "a", "b", "c");
} }
public void testParseInfiniteIndirectReference() { public void testParseInfiniteIndirectReference() {
assertError("Infinite indirection", assertError("Infinite indirection",
"1,!label/infinite_indirection,2", "1", "infinite", "<infinite>", "loop", "2"); "1,!text/infinite_indirection,2", "1", "infinite", "<infinite>", "loop", "2");
assertError("INFINITE INDIRECTION", assertError("INFINITE INDIRECTION",
"1,!LABEL/INFINITE_INDIRECTION,2", "1", "infinite", "<infinite>", "loop", "2"); "1,!TEXT/INFINITE_INDIRECTION,2", "1", "infinite", "<infinite>", "loop", "2");
assertError("Upper infinite indirection", assertError("Upper infinite indirection",
"1,!label/upper_infinite_indirection,2", "1,!text/upper_infinite_indirection,2",
"1", "infinite", "<infinite>", "loop", "2"); "1", "infinite", "<infinite>", "loop", "2");
assertError("Upper INFINITE INDIRECTION", assertError("Upper INFINITE INDIRECTION",
"1,!LABEL/UPPER_INFINITE_INDIRECTION,2", "1,!TEXT/UPPER_INFINITE_INDIRECTION,2",
"1", "infinite", "<infinite>", "loop", "2"); "1", "infinite", "<infinite>", "loop", "2");
} }
public void testLabelReferece() { public void testLabelReferece() {
assertTextArray("Label time am", "!label/label_time_am", "AM"); assertTextArray("Label time am", "!text/label_time_am", "AM");
assertTextArray("LABEL TIME AM", "!LABEL/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"); "!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"); "!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"); "!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"); "!icon/settings_key|!code/key_settings");
assertTextArray("Indirect naviagte actions as more key", assertTextArray("Indirect naviagte actions as more key",
"!label/indirect_navigate_actions_as_more_key", "!text/indirect_navigate_actions_as_more_key",
"!fixedColumnOrder!2", "!fixedColumnOrder!2",
"!hasLabels!", "Prev|!code/key_action_previous", "!hasLabels!", "Prev|!code/key_action_previous",
"!hasLabels!", "Next|!code/key_action_next"); "!hasLabels!", "Next|!code/key_action_next");
assertTextArray("INDIRECT NAVIGATE ACTIONS AS MORE KEY", assertTextArray("INDIRECT NAVIGATE ACTIONS AS MORE KEY",
"!LABEL/INDIRECT_NAVIGATE_ACTIONS_AS_MORE_KEY", "!TEXT/INDIRECT_NAVIGATE_ACTIONS_AS_MORE_KEY",
"!fixedColumnOrder!2", "!fixedColumnOrder!2",
"!hasLabels!", "Prev|!code/key_action_previous", "!hasLabels!", "Prev|!code/key_action_previous",
"!hasLabels!", "Next|!code/key_action_next"); "!hasLabels!", "Next|!code/key_action_next");

View File

@ -30,7 +30,7 @@ import java.util.Locale;
public class KeySpecParserTests extends AndroidTestCase { public class KeySpecParserTests extends AndroidTestCase {
private final KeyboardCodesSet mCodesSet = new KeyboardCodesSet(); 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 CODE_SETTINGS = "!code/key_settings";
private static final String ICON_SETTINGS = "!icon/settings_key"; private static final String ICON_SETTINGS = "!icon/settings_key";
@ -49,8 +49,8 @@ public class KeySpecParserTests extends AndroidTestCase {
final String language = Locale.ENGLISH.getLanguage(); final String language = Locale.ENGLISH.getLanguage();
mCodesSet.setLanguage(language); mCodesSet.setLanguage(language);
mLabelsSet.setLanguage(language); mTextsSet.setLanguage(language);
mLabelsSet.loadStringResources(getContext()); mTextsSet.loadStringResources(getContext());
mCodeSettings = KeySpecParser.parseCode( mCodeSettings = KeySpecParser.parseCode(
CODE_SETTINGS, mCodesSet, CODE_UNSPECIFIED); CODE_SETTINGS, mCodesSet, CODE_UNSPECIFIED);
@ -61,7 +61,7 @@ public class KeySpecParserTests extends AndroidTestCase {
private void assertParser(String message, String moreKeySpec, String expectedLabel, private void assertParser(String message, String moreKeySpec, String expectedLabel,
String expectedOutputText, int expectedIcon, int expectedCode) { 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); final MoreKeySpec spec = new MoreKeySpec(labelResolved, mCodesSet);
assertEquals(message + " [label]", expectedLabel, spec.mLabel); assertEquals(message + " [label]", expectedLabel, spec.mLabel);
assertEquals(message + " [ouptputText]", expectedOutputText, spec.mOutputText); assertEquals(message + " [ouptputText]", expectedOutputText, spec.mOutputText);
@ -257,21 +257,21 @@ public class KeySpecParserTests extends AndroidTestCase {
} }
public void testResourceReference() { 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); 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); 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); "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); "Next", null, ICON_UNDEFINED, mCodeActionNext);
assertParser("Popular domain", 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); ".com", ".com ", ICON_UNDEFINED, CODE_OUTPUT_TEXT);
assertParser("POPULAR DOMAIN", 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); ".com", ".com ", ICON_UNDEFINED, CODE_OUTPUT_TEXT);
} }

View File

@ -1 +0,0 @@
Main-Class: com.android.inputmethod.latin.makelabel.LabelMaker

View File

@ -20,7 +20,7 @@ LOCAL_SRC_FILES += $(call all-java-files-under,src)
LOCAL_JAR_MANIFEST := etc/manifest.txt LOCAL_JAR_MANIFEST := etc/manifest.txt
LOCAL_JAVA_RESOURCE_DIRS := res LOCAL_JAVA_RESOURCE_DIRS := res
LOCAL_MODULE_TAGS := eng LOCAL_MODULE_TAGS := eng
LOCAL_MODULE := makelabel LOCAL_MODULE := maketext
include $(BUILD_HOST_JAVA_LIBRARY) include $(BUILD_HOST_JAVA_LIBRARY)
include $(LOCAL_PATH)/etc/Android.mk include $(LOCAL_PATH)/etc/Android.mk

View File

@ -17,5 +17,5 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := eng LOCAL_MODULE_TAGS := eng
LOCAL_PREBUILT_EXECUTABLES := makelabel LOCAL_PREBUILT_EXECUTABLES := maketext
include $(BUILD_HOST_PREBUILT) include $(BUILD_HOST_PREBUILT)

View File

@ -33,7 +33,7 @@ progdir=`pwd`
prog="${progdir}"/`basename "${prog}"` prog="${progdir}"/`basename "${prog}"`
cd "${oldwd}" cd "${oldwd}"
jarfile=makelabel.jar jarfile=maketext.jar
frameworkdir="$progdir" frameworkdir="$progdir"
if [ ! -r "$frameworkdir/$jarfile" ] if [ ! -r "$frameworkdir/$jarfile" ]
then then

View File

@ -0,0 +1 @@
Main-Class: com.android.inputmethod.latin.maketext.LabelText

View File

@ -25,23 +25,23 @@ import java.util.HashMap;
/** /**
* !!!!! DO NOT EDIT THIS FILE !!!!! * !!!!! DO NOT EDIT THIS FILE !!!!!
* This file is generated by tools/makelabel. * This file is generated by tools/maketext.
*/ */
public final class KeyboardLabelsSet { public final class KeyboardTextsSet {
// Language to labels map. // Language to texts map.
private static final HashMap<String, String[]> sLocaleToLabelsMap = private static final HashMap<String, String[]> sLocaleToTextsMap =
new HashMap<String, String[]>(); new HashMap<String, String[]>();
private static final HashMap<String, Integer> sLowerCaseNameToIdsMap = private static final HashMap<String, Integer> sLowerCaseNameToIdsMap =
new HashMap<String, Integer>(); new HashMap<String, Integer>();
private String[] mLabels; private String[] mTexts;
// Resource name to label map. // Resource name to text map.
private HashMap<String, String> mResourceNameToLabelsMap = new HashMap<String, String>(); private HashMap<String, String> mResourceNameToTextsMap = new HashMap<String, String>();
public void setLanguage(final String language) { public void setLanguage(final String language) {
mLabels = sLocaleToLabelsMap.get(language); mTexts = sLocaleToTextsMap.get(language);
if (mLabels == null) { if (mTexts == null) {
mLabels = LANGUAGE_DEFAULT; mTexts = LANGUAGE_DEFAULT;
} }
} }
@ -56,31 +56,31 @@ public final class KeyboardLabelsSet {
final String packageName = res.getResourcePackageName(referenceId); final String packageName = res.getResourcePackageName(referenceId);
for (final String resName : resourceNames) { for (final String resName : resourceNames) {
final int resId = res.getIdentifier(resName, "string", packageName); 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 lowerCaseName = null;
String label = mResourceNameToLabelsMap.get(name); String text = mResourceNameToTextsMap.get(name);
if (label == null) { if (text == null) {
lowerCaseName = name.toLowerCase(); lowerCaseName = name.toLowerCase();
label = mResourceNameToLabelsMap.get(lowerCaseName); text = mResourceNameToTextsMap.get(lowerCaseName);
} }
if (label != null) { if (text != null) {
return label; return text;
} }
Integer id = sLowerCaseNameToIdsMap.get(name); Integer id = sLowerCaseNameToIdsMap.get(name);
if (id == null) { if (id == null) {
id = sLowerCaseNameToIdsMap.get(lowerCaseName); // lowerCaseName != null id = sLowerCaseNameToIdsMap.get(lowerCaseName); // lowerCaseName != null
} }
if (id == null) throw new RuntimeException("Unknown label: " + name); if (id == null) throw new RuntimeException("Unknown label: " + name);
label = (id < mLabels.length) ? mLabels[id] : null; text = (id < mTexts.length) ? mTexts[id] : null;
return (label == null) ? LANGUAGE_DEFAULT[id] : label; return (text == null) ? LANGUAGE_DEFAULT[id] : text;
} }
private static final String[] RESOURCE_NAMES = { private static final String[] RESOURCE_NAMES = {
// These labels' name should be aligned with the @string/<name> in values/strings.xml. // These texts' name should be aligned with the @string/<name> in values/strings.xml.
// Labels for action. // Labels for action.
"label_go_key", "label_go_key",
// "label_search_key", // "label_search_key",
@ -102,14 +102,14 @@ public final class KeyboardLabelsSet {
private static final String EMPTY = ""; private static final String EMPTY = "";
/* Default labels */ /* Default texts */
private static final String[] LANGUAGE_DEFAULT = { private static final String[] LANGUAGE_DEFAULT = {
/* @DEFAULT_LABELS@ */ /* @DEFAULT_TEXTS@ */
}; };
/* @LABELS@ */ /* @TEXTS@ */
private static final Object[] LANGUAGES_AND_LABELS = { private static final Object[] LANGUAGES_AND_TEXTS = {
/* @LANGUAGES_AND_LABELS@ */ /* @LANGUAGES_AND_TEXTS@ */
}; };
static { static {
@ -118,10 +118,10 @@ public final class KeyboardLabelsSet {
sLowerCaseNameToIdsMap.put(name, id++); sLowerCaseNameToIdsMap.put(name, id++);
} }
for (int i = 0; i < LANGUAGES_AND_LABELS.length; i += 2) { for (int i = 0; i < LANGUAGES_AND_TEXTS.length; i += 2) {
final String language = (String)LANGUAGES_AND_LABELS[i]; final String language = (String)LANGUAGES_AND_TEXTS[i];
final String[] labels = (String[])LANGUAGES_AND_LABELS[i + 1]; final String[] texts = (String[])LANGUAGES_AND_TEXTS[i + 1];
sLocaleToLabelsMap.put(language, labels); sLocaleToTextsMap.put(language, texts);
} }
} }
} }

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.inputmethod.latin.makelabel; package com.android.inputmethod.latin.maketext;
import java.io.PrintStream; import java.io.PrintStream;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.inputmethod.latin.makelabel; package com.android.inputmethod.latin.maketext;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;

View File

@ -14,14 +14,14 @@
* the License. * the License.
*/ */
package com.android.inputmethod.latin.makelabel; package com.android.inputmethod.latin.maketext;
import java.util.Arrays; import java.util.Arrays;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import java.util.jar.JarFile; import java.util.jar.JarFile;
public class LabelMaker { public class LabelText {
static class Options { static class Options {
private static final String OPTION_JAVA = "-java"; private static final String OPTION_JAVA = "-java";
@ -58,7 +58,7 @@ public class LabelMaker {
public static void main(final String[] args) { public static void main(final String[] args) {
final Options options = new Options(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); final MoreKeysResources resources = new MoreKeysResources(jar);
resources.writeToJava(options.mJava); resources.writeToJava(options.mJava);
} }

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.inputmethod.latin.makelabel; package com.android.inputmethod.latin.maketext;
import java.io.Closeable; import java.io.Closeable;
import java.io.File; import java.io.File;
@ -30,13 +30,13 @@ import java.util.Locale;
import java.util.jar.JarFile; import java.util.jar.JarFile;
public class MoreKeysResources { 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_NAMES = "@NAMES@";
private static final String MARK_DEFAULT_LABELS = "@DEFAULT_LABELS@"; private static final String MARK_DEFAULT_TEXTS = "@DEFAULT_TEXTS@";
private static final String MARK_LABELS = "@LABELS@"; private static final String MARK_TEXTS = "@TEXTS@";
private static final String MARK_LANGUAGES_AND_LABELS = "@LANGUAGES_AND_LABELS@"; private static final String MARK_LANGUAGES_AND_TEXTS = "@LANGUAGES_AND_TEXTS@";
private static final String DEFAUT_LANGUAGE_NAME = "DEFAULT"; private static final String DEFAUT_LANGUAGE_NAME = "DEFAULT";
private static final String ARRAY_NAME_FOR_LANGUAGE = "LANGUAGE_%s"; private static final String ARRAY_NAME_FOR_LANGUAGE = "LANGUAGE_%s";
private static final String EMPTY_STRING_VAR = "EMPTY"; private static final String EMPTY_STRING_VAR = "EMPTY";
@ -53,7 +53,7 @@ public class MoreKeysResources {
public MoreKeysResources(final JarFile jar) { public MoreKeysResources(final JarFile jar) {
mJar = jar; mJar = jar;
final ArrayList<String> resources = JarUtils.getNameListing(jar, LABEL_RESOURCE_NAME); final ArrayList<String> resources = JarUtils.getNameListing(jar, TEXT_RESOURCE_NAME);
for (final String name : resources) { for (final String name : resources) {
final String dirName = name.substring(0, name.lastIndexOf('/')); final String dirName = name.substring(0, name.lastIndexOf('/'));
final int pos = dirName.lastIndexOf('/'); final int pos = dirName.lastIndexOf('/');
@ -118,11 +118,11 @@ public class MoreKeysResources {
while ((line = in.readLine()) != null) { while ((line = in.readLine()) != null) {
if (line.contains(MARK_NAMES)) { if (line.contains(MARK_NAMES)) {
dumpNames(out); dumpNames(out);
} else if (line.contains(MARK_DEFAULT_LABELS)) { } else if (line.contains(MARK_DEFAULT_TEXTS)) {
dumpDefaultLabels(out); dumpDefaultTexts(out);
} else if (line.contains(MARK_LABELS)) { } else if (line.contains(MARK_TEXTS)) {
dumpLabels(out); dumpTexts(out);
} else if (line.contains(MARK_LANGUAGES_AND_LABELS)) { } else if (line.contains(MARK_LANGUAGES_AND_TEXTS)) {
dumpLanguageMap(out); dumpLanguageMap(out);
} else { } else {
out.println(line); 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); 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 StringResourceMap defaultResMap = mResourcesMap.get(DEFAUT_LANGUAGE_NAME);
final ArrayList<String> allLanguages = new ArrayList<String>(); final ArrayList<String> allLanguages = new ArrayList<String>();
allLanguages.addAll(mResourcesMap.keySet()); allLanguages.addAll(mResourcesMap.keySet());
@ -158,7 +158,7 @@ public class MoreKeysResources {
out.format(" private static final String[] " + ARRAY_NAME_FOR_LANGUAGE + " = {\n", out.format(" private static final String[] " + ARRAY_NAME_FOR_LANGUAGE + " = {\n",
language); language);
final StringResourceMap resMap = mResourcesMap.get(language); final StringResourceMap resMap = mResourcesMap.get(language);
dumpLabelsInternal(out, resMap, defaultResMap); dumpTextsInternal(out, resMap, defaultResMap);
out.format(" };\n\n"); 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 StringResourceMap defaultResMap) {
final ArrayInitializerFormatter formatter = final ArrayInitializerFormatter formatter =
new ArrayInitializerFormatter(out, 100, " "); new ArrayInitializerFormatter(out, 100, " ");
@ -235,7 +235,7 @@ public class MoreKeysResources {
String t = text; String t = text;
t = replaceAll(t, "\\?", "?"); t = replaceAll(t, "\\?", "?");
t = replaceAll(t, "\\@", "@"); t = replaceAll(t, "\\@", "@");
t = replaceAll(t, "@string/", "!label/"); t = replaceAll(t, "@string/", "!text/");
return t; return t;
} }

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
package com.android.inputmethod.latin.makelabel; package com.android.inputmethod.latin.maketext;
public class StringResource { public class StringResource {
public final String mName; public final String mName;

Some files were not shown because too many files have changed in this diff Show More