mercredi 26 mai 2021

Google Pixel phones may offer to translate apps for you on Android 12

One of the biggest hurdles to joining Team Pixel is availability: Google just doesn’t sell their phones in every country like Samsung or Apple. For example, Google’s upcoming Pixel 5a 5G is only confirmed to launch in two countries so far: the U.S. and Japan. Importing a Pixel phone is always an option, and Google does a great job at making sure its software is readable in most languages. But what about third-party services? In Chrome, you can use the built-in translation tool to translate webpages to your native tongue, but there’s currently no way to do that for Android apps. That’s set to change with a new feature in Android 12, and we’ve spotted evidence suggesting it’ll be available on Pixel phones.

Back in April, we reported that Google was working on a new framework in Android 12 for translating an app’s UI to the user’s native language. After the launch of the first Android 12 Beta at Google I/O 2021, Google updated its API differences report with a new android.view.translation package as well as related methods in the View class that match what we found last month. However, these new APIs are undocumented, meaning we can only make educated guesses at their intended use. In a blog post, developer CommonsWare corroborated our interpretation of this new feature, which is set to offer “system-supplied translations of user-visible strings.” As he points out, this feature may pose a challenge to developers if it’s made mandatory, but it’ll no doubt make apps with limited language support more accessible to users.

However, app UI translations won’t be a standard feature of Android 12 as support will depend on a system-defined “translation service” to be present. This translation service is defined by the value config_defaultTranslationService in the framework, and as developer kdrag0n pointed out to us, this value is actually defined in Android 12 Beta 1 for Pixel phones. Specifically, config_defaultTranslationService is set to com.google.android.as/com.google.android.apps.miphone.aiai.translate.services.TranslationService where “com.google.android.as” is the package name for Device Personalization Services and “com.google.android.apps.miphone.aiai.translate.services.TranslationService” is the name of the translation service provided by the app.

Screenshot of strings.xml in PixelConfigOverlayCommon found in Android 12 Beta 1 for Pixel phones

Current versions of the Device Personalization Services app do not actually have this service, so we can’t actually test Android 12’s new UI translation feature on Pixel phones. Once Device Personalization Services is updated, we should be able to finally test this new feature. Since Google set the value of config_defaultTranslationService using a Runtime Resource Overlay (RRO) called “PixelConfigOverlayCommon”, we believe for now that this feature won’t be limited to a specific Pixel phone once it’s released. If Google intended to limit access to a specific Pixel device, they could have defined the value in one or more of the PixelConfigOverlay APKs that are included for a generation or more of Pixel devices (eg. PixelConfigOverlay2019 for the Pixel 4 and later). We won’t know for sure until the feature is released, though, and it’s likely that won’t happen until the launch of the Pixel 6 series later this fall.

The post Google Pixel phones may offer to translate apps for you on Android 12 appeared first on xda-developers.



from xda-developers https://ift.tt/3hROtCB
via IFTTT

Aucun commentaire:

Enregistrer un commentaire