Android 12 can automatically translate apps into your native language

With over 2.5 billion active users, Android is the most used operating system in the world. While the operating system itself has been localized in dozens of different languages, this is not the case for many third-party applications. Larger companies can locate their own applications or hire professional translation services, but these options are not economically feasible for smaller teams or independent application developers. At best, a smaller team or a standalone application developer can collect translation sources from native speakers and, at worst, use machine translation services to do the job. However, this could change in Android 12, as we have seen evidence to suggest that Google may be working on a framework for the automatic translation of the user interface of an application into the user’s native language.

A removal of the APK can often predict features that may appear in a future update of an application, but any of the features mentioned here may not do so in a future release. This is because these features are currently not implemented in the live version and can be extracted at any time by the developers in a future version.

Earlier this week, we got an unreleased version of Android 12 that contains some new features and UI changes. As we explored the version, we discovered a lot of new classes in the context of a new “translation service”. Our search began when we discovered two new permissions added to this version of Android 12: BIND_TRANSLATION_SERVICE and MANAGE_UI_TRANSLATION. Android SystemUI has the previous permission to bind to an application that has the last permission, which is defined by the value by default config_defaultTranslationService. An application such as Google Translate or Device Personalization Services can probably be set up as a translation service, but Google can open it to third-party applications such as MANAGE_UI_TRANSLATION permission has a “role” defined as one of the accepted levels of protection. If you remember, Android 10 added “Roles” that define applications that should have certain privileges; Google may add “Translator” as a role, but we don’t know if this role can be assigned to user-installed applications.

In any case, I found references to these permissions in the framework code, where I noticed evidence that this new translation code acts on visualizations within activities, rather than on a screenshot or recent dashboard. Translating text into screenshots or the recent apps panel can already be done by Google Lens, and with device customization services, the text can be translated right from the recent apps panel. Meanwhile, the Android intention system already allows basic text sharing to be translated. However, this new framework seems to be more complex and low-level, and we believe that it aims to translate text directly into an application’s user interface, replacing online text to make the translation feel more native.

We’ve reviewed the latest versions of Google’s translation services and customization devices, but found no evidence of integration with this new API. This API may not use Google Translate directly, but rather another API endpoint. If this feature is implemented in accordance with our speculation, we doubt that Google will charge users for this feature. However, they may allow interface translations using Google Translate as an exclusive Pixel feature. As the framework seems to come to AOSP, however, OEMs may be able to define their own translation service if they do not want to use the Google service.

Third-party applications, such as AllTrans, have for years provided their own feature for translating the user interface. Developed by the Xposed Framework, these modes work similarly to how we believe the UI translation of Android 12 will work, connecting directly to an app’s views to translate and replace text. However, these modes require users to retrieve their own API key for a translation service, as a shared key would exceed the free limit fairly quickly. As Google seems to be building a UI translation framework directly in Android 12, however, users should no longer have to root their device to translate apps into their native language. We hope this will make thousands of applications more accessible to users around the world.

Using the Xposed Framework, AllTrans connects to in-app text views to translate text using Microsoft’s Translator.

Developers will also benefit from automatic translations of the user interface. Developers who do not have the resources to translate their application or who do not want to use machine translation can allow the operating system to manage things. The release of an automatically translated application may result in negative reviews from users blaming the developer for poor translation, but if the user directs the operating system to translate the application, it will result in less frustration as the user better understands where to blame any poorly translated text.

While we’re pretty sure that this feature is intended to translate the user interface into applications, we’re not 100% sure that’s the case until we see the feature in action. An alternative use of this feature would be to translate the user interface into the operating system or only into system applications, but we believe this is unlikely because the operating system is already widely located and any localization can be done before the device leave the factory or through an OTA update. On the other hand, Google and OEMs can’t take into account which languages ​​an application supports, so this feature would help fill the gap. Because Google is developing this visualization feature, making it usable in all applications, it also makes it more likely to be used in applications rather than in the operating system. Again, however, we will not know for sure until this feature is released, which may or may not happen in the stable version of Android 12.

Thanks to developers Quinny899 and kdrag0n for their assistance in analyzing this code. Thanks also to PNF Software for providing us with a license to use JEB decompiler, a professional-grade reverse engineering tool for Android applications.

Source