Devices running Marshmallow who have Google’s Translate app installed will be able to translate text in 90 languages right within apps that support Android’s text selection behavior.
As shown in these demos, it’ll work on displayed text as well as anything you type in. You’ll be able to view the translation in a pop-up, change target language and have it read out loud.
For those apps that don’t use Android’s selection functionality, the company has detailed instructions on how to integrate translation options.
➤ In-app translations in Android Marshmallow [Android Developers Blog]