

Before you download languages, connect to Wi-Fi.". you want to download a language for offline use, be sure to download the Google Translate app first, which is free on Apple’s App Store and Google Play. I.putExtra("key_text_input", "Oh my God! What is going on?") The action and the parameter names have changed. But the codes for Chinese are zh-CN and zh-TW. If you have an impression that no data is passed (at all), maybe it is because you use 3-character language codes instead of 2-character ones. There's a gotcha: "key_text_input" takes preference over Intent.EXTRA_TEXT, and "to" and "from" work only with "key_text_input". ".translate.HomeActivity")) Īs you can see, this is the standard ACTION_SEND with additional parameters "to" and "from". i.putExtra("key_from_floating_window", false) i.putExtra("key_suggest_translation", "") I.putExtra("key_text_input", "Oh my God! What is going on here?") The following code works with the new version of Google Translate Application: Intent i = new Intent() So: how do I pass the languages to the Google Translate App now? What actually happened when I ran this code was: the Google Translator asked me if I want to translate from English and translated "What is going on?" to French. I.setComponent(new ComponentName(".translate", I.putExtra("key_from_floating_window", false) I.putExtra("key_suggest_translation", "") I.putExtra("key_text_input", "What time is it?") I.putExtra(Intent.EXTRA_TEXT, "What is going on?") The best I can do is to use ACTION_SEND, but it ignores the two languages: Intent i = new Intent() (yes, I tried to replace my code by that code, the Google Translator App behaves as if it does not receive any data.)Ĭurrently I cannot specify the text and the two languages.

Returning Translated Text from Google Translate Activity The code is identical to the code given here: The problem is that invoking the Google Translator App does not work anymore, although it did once. I wrote a program that invokes Google Translator android application via Intent.ACTION_VIEW.
