First of all I’ve seen everywhere in the Documentation thatlanguage:
capability is only for simulator but as I see in this commit here the default language is taken from there (in ios, because in android it makes an ADB command to get the language in real time, correct me if I’m wrong).
Also there is a problem with getting regional languages. I’m not able to get /values-en-rGB/strings.xml (and same for Brazilian Portuguese, etc.) It only loads the base language of both.
Android example:
[debug] [ADB] Current device property ‘persist.sys.locale’: pt-PT
[AndroidDriver] No language specified, returning strings for: pt
[debug] [AndroidDriver] Extracting strings from apk /path_to_app.apk pt /var/folders/q6/h757481s0331g8jz4t7tg1300000gp/T/com.company.game.pre
[debug] [ADB] Extracting strings for language: pt
[debug] [ADB] Reading strings from converted strings.json
It can be done like app_strings("en-rGB")["key.to.find.by"]
but i think is better to solve this little issue which is needed to simple add an r
character after the -
character (if exists).
I hope you could understand everything.