Detox icon indicating copy to clipboard operation
Detox copied to clipboard

Add ability to change language for Android

Open amq opened this issue 2 years ago • 4 comments

Describe your idea

Following up on https://github.com/wix/Detox/issues/683 and https://github.com/wix/Detox/pull/873 which implemented the ability to change language between tests on iOS.

Would be great to have the same functionality also on Android.

My use cases:

  • testing i18n
  • making screenshots for stores

amq avatar Mar 23 '22 15:03 amq

@jonathanmos could you comment on this, please?

noomorph avatar Apr 09 '22 06:04 noomorph

I don't know whether we will have the capacity to implement this in the near future, but it looks like it could be done with an api to the emulator cmdline flags without requiring superuser (although only on 29+)

jonathanmos avatar Apr 27 '22 14:04 jonathanmos

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this reporsitory, read this discussion.

stale[bot] avatar Jun 18 '22 16:06 stale[bot]

It looks like this will require a new resolver for the avd version + whether it's a playstore image. We also need to check how it would affect the flow given that changing the language this way restarts the avd.

jonathanmos avatar Jul 19 '22 11:07 jonathanmos

@jonathanmos looks like we don't have the capacity for this. Could you be kind to sum up what you think the solution should be like, so we could put this at the community's doorstep?

d4vidi avatar Nov 24 '22 12:11 d4vidi

There is an api for api >= 29 to change the device language e.g. emulator -avd <avd-name> -change-language es. To expose this api we would need first to validate that the emulator is indeed running api >= 29 and that the image is not from the playstore, and at the moment we don't have such a resolver.

Documentation of the change-language api

jonathanmos avatar Nov 24 '22 13:11 jonathanmos