Migrate voice features into the open-source LatinIME. This includes
the change to logging to remove any private dependencies and use
broadcast intents to VoiceSearch instead.
I have audited this code and it appears good to go for open-source,
but would appreciate a second pair of eyes.
Still to do after submitting this CL:
* Reintroduce Amith's memory leak fix (37557) which was the only CL
added to LatinIME since the last merge over to the private copy.
* Make some changes to allow LatinIME to work without voice search
installed. Currently I believe it will show the mic but fail if
you press it. We need to base the visibility on the mic on the
availability of the service.
* Fix this code to use the new Gservices framework, it's still trying
to use the old one.
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 3b3965e..90cd6d4 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -93,13 +93,13 @@
</string-array>
<!-- Don't translate -->
- <string name="prediction_none" >0</string>
+ <string name="prediction_none" translatable="false">0</string>
<!-- Don't translate -->
- <string name="prediction_basic">1</string>
+ <string name="prediction_basic" translatable="false">1</string>
<!-- Don't translate -->
- <string name="prediction_full" >2</string>
+ <string name="prediction_full" translatable="false">2</string>
- <string-array name="prediction_modes_values">
+ <string-array name="prediction_modes_values" translatable="false">
<item>@string/prediction_none</item>
<item>@string/prediction_basic</item>
<item>@string/prediction_full</item>
@@ -125,13 +125,7 @@
<string name="alternates_for_c">ç</string>
<!-- Accented forms of "y" -->
<string name="alternates_for_y">ýÿ</string>
-
- <!-- Label to display on the lower "i" key.
- Usually you don't need to modify this value, but if your locale requires some variant
- for this character (e.g. \\u131 "Latin Small Letter Dotoless i"), please modify this
- value. -->
- <string name="key_i">i</string>
-
+
<!-- Tip to long press on keys -->
<string name="tip_long_press">Hold a key down to see accents (ø, ö, etc.)</string>
<!-- Tip to dismiss keyboard -->
@@ -185,6 +179,85 @@
<!-- Label for ALT modifier key. Must be short to fit on key! -->
<string name="label_alt_key">ALT</string>
+ <!-- Voice related labels -->
+
+ <!-- Title of the warning dialog that shows when a user initiates voice input for
+ the first time. -->
+ <string name="voice_warning_title">Voice input</string>
+
+ <!-- Message that gets put at the top of the warning dialog if the user is attempting to use
+ voice input in a currently unsupported locale. Voice input will work for such a user,
+ but it will only recognize them in English. -->
+ <string name="voice_warning_locale_not_supported">Voice input is not currently supported for your language, but does work in English.</string>
+
+ <!-- Message of the warning dialog that shows when a user initiates voice input for
+ the first time, or turns it on in settings. -->
+ <string name="voice_warning_may_not_understand">Voice input is an experimental feature using Google\'s networked speech recognition.</string>
+
+ <!-- An additional part of the warning dialog for voice input that only shows when the user
+ actually initiates voice input, rather than just turning it on in settings. -->
+ <string name="voice_warning_how_to_turn_off">To turn off voice input, go to keyboard settings.</string>
+
+ <!-- Message to show when user clicks the swiping hint (which says
+ "Swipe across keyboard to speak"). Also shown when enabling settings. -->
+ <string name="voice_hint_dialog_message">To use voice input, press the microphone button or slide your finger across the on-screen keyboard.</string>
+
+ <!-- Short message to tell the user the system is ready for them to speak. -->
+ <string name="voice_listening">Speak now</string>
+
+ <!-- Short message shown after the user finishes speaking. -->
+ <string name="voice_working">Working</string>
+
+ <!-- Short message shown before the user should speak. -->
+ <string name="voice_initializing"></string>
+
+ <!-- Short message shown when a generic error occurs. -->
+ <string name="voice_error">Error. Please try again.</string>
+
+ <!-- Short message shown for a network error. -->
+ <string name="voice_network_error">Couldn\'t connect</string>
+
+ <!-- Short message shown for a network error where the utterance was really long,
+ in which case we should suggest that the user speak less. -->
+ <string name="voice_too_much_speech">Error, too much speech.</string>
+
+ <!-- Short message shown for an audio error. -->
+ <string name="voice_audio_error">Audio problem</string>
+
+ <!-- Short message shown for an error with the voice server. -->
+ <string name="voice_server_error">Server error</string>
+
+ <!-- Short message shown when no speech is heard. -->
+ <string name="voice_speech_timeout">No speech heard</string>
+
+ <!-- Short message shown when the server couldn't parse any speech. -->
+ <string name="voice_no_match">No matches found</string>
+
+ <!-- Short message shown when the user initiates voice and voice
+ search is not installed. -->
+ <string name="voice_not_installed">Voice search not installed</string>
+
+ <!-- Short hint shown in candidate view to explain voice input. -->
+ <string name="voice_swipe_hint"><b>Hint:</b> Swipe across keyboard to speak</string>
+
+ <!-- Short hint shown in candidate view to explain that user can speak punctuation. -->
+ <string name="voice_punctuation_hint"><b>Hint:</b> Next time, try speaking punctuation like \"period\", \"comma\", or \"question mark\".</string>
+
+ <!-- Label on button to stop recognition. Must be short to fit on button. -->
+ <string name="cancel">Cancel</string>
+
+ <!-- Label on button when an error occurs -->
+ <string name="ok">OK</string>
+
+ <!-- Preferences item for enabling speech input -->
+ <string name="enable_voice">Voice input</string>
+
+ <!-- Press the "enter" key after the user speaks. Option on settings.-->
+ <string name="auto_submit">Auto submit after voice</string>
+
+ <!-- Press the "enter" key after the user speaks. Summary of option in settings.-->
+ <string name="auto_submit_summary">Automatically press enter when searching or going to the next field.</string>
+
<!-- IME Tutorial screen (ROMAN) --><skip />
<!-- appears above image showing the user to click on a TextView to show the IME -->
<string name="open_the_keyboard"><font size="17"><b>Open the keyboard\n</b></font><font size="3">\n</font>Touch any text field.</string>
@@ -197,7 +270,7 @@
<!-- appears above image showing how to access keyboard settings -->
<string name="keyboard_settings"><font size="17"><b>Keyboard settings\n</b></font><font size="3">\n</font>Touch \u0026 hold the <b>\?123\</b> key.</string>
-
+
<!-- popular web domains for the locale - most popular, displayed on the keyboard -->
<string name="popular_domain_0">".com"</string>
<!-- popular web domains for the locale - item 1, displayed in the popup -->
@@ -208,6 +281,9 @@
<string name="popular_domain_3">".gov"</string>
<!-- popular web domains for the locale - item 4, displayed in the popup -->
<string name="popular_domain_4">".edu"</string>
+
+ <!-- Menu item for launching Input method switcher -->
+ <string name="inputMethod">Input method</string>
<!-- Title for input language selection screen -->
<string name="language_selection_title">Select input languages</string>