screenshots icon indicating copy to clipboard operation
screenshots copied to clipboard

Support for Hebrew locale on Android

Open amitkot opened this issue 5 years ago • 3 comments

My app is localised for multiple locales, one of which uses Hebrew language. When running screenshots with an Android emulator, the mechanism for switching locales is currently not working properly for Hebrew.

After the locale is changed to he-IL, the process gets stuck and never advances.

I used he-IL and running screenshots -v I noticed that the adb log command is waiting for an input that never arrives.

It seems there is an old standard for locales with Hebrew that used iw instead of he, and although the locale is now he-IL everywhere, the tools whose logs are being grepped doesn't output he. When running with the locale iw-IL, the screenshots tool worked fine for Android, but the screenshots were in iw-IL folder and iOS did not work properly.

amitkot avatar Feb 02 '20 10:02 amitkot

The grep command when using he-IL:

/usr/local/share/android-sdk/platform-tools/adb -s emulator-5554 logcat -b main *:S
ContactsDatabaseHelper:I ContactsProvider:I -e he_IL

Output without requiring the he-IL shows the service outputs iw_IL instead:

$ /usr/local/share/android-sdk/platform-tools/adb -s emulator-5554 logcat -b main *:S ContactsDatabaseHelper:I ContactsProvider:I
02-02 12:16:29.625  6445  6445 I ContactsDatabaseHelper: updateUseStrictPhoneNumberComparison: US
02-02 12:16:30.794  6445  6639 I ContactsProvider: Locale has changed from [en_US] to [iw_IL]
02-02 12:16:30.888  6445  6639 I ContactsDatabaseHelper: Switching to locale [iw_IL] (ICU v63.2.0.0)
02-02 12:16:31.002  6445  6639 I ContactsDatabaseHelper: Locale change completed in 113ms
02-02 12:16:31.005  6445  6639 I ContactsDatabaseHelper: Switching to locale [iw_IL] (ICU v63.2.0.0)
02-02 12:16:31.281  6445  6639 I ContactsDatabaseHelper: Locale change completed in 275ms
02-02 12:17:26.138  8703  8703 I ContactsDatabaseHelper: updateUseStrictPhoneNumberComparison: US
02-02 12:18:35.962  9516  9516 I ContactsDatabaseHelper: updateUseStrictPhoneNumberComparison: US

amitkot avatar Feb 02 '20 10:02 amitkot

Seems that Android emulator now supports setting the locale when starting it:

emulator -avd <avd-name> -change-locale fr-CA

Source - https://androidstudio.googleblog.com/2019/09/emulator-29112-stable.html

amitkot avatar Feb 05 '20 11:02 amitkot

You might be using an older emulator? Thanks for the tip!

mmcc007 avatar Mar 23 '20 06:03 mmcc007