ui-screen-shooter icon indicating copy to clipboard operation
ui-screen-shooter copied to clipboard

Region/Locale not set properly in XCode6

Open mr-brandt opened this issue 10 years ago • 2 comments

I am trying to make screenshots in different languages, but every language must use its own locale as i am showing currencies in the screenshot. However the languages array in ui-screen-shooter.sh is set to 'languages="de-DE en-US en-GB"'. The effect however ist that the language in the simulator is set accoringly, but the currency does not reflect the approprioate region.

Is there any solution to this or is it a change how Instrumentation works in Xcode6?

Thanks and regards.

mr-brandt avatar Oct 05 '14 22:10 mr-brandt

This is the same situation also being discussed over here: https://github.com/jonathanpenn/ui-screen-shooter/issues/32. Whatever solution comes out of that issue will address this one as well.

jonathanpenn avatar Oct 06 '14 05:10 jonathanpenn

My solution was to export a language environment variable in ui-screen-shooter.sh:

for simulator in "${simulators[@]}"; do
  for language in $languages; do
    export UISS_LANG="$language"
    ...

and then pull this into my automation script like this and use it to change units etc. based on the locale:

var result = target.host().performTaskWithPathArgumentsTimeout("/usr/bin/printenv" , ["UISS_LANG"], 5);
var language = result.stdout.substring(0,result.stdout.length-1);
UIALogger.logMessage("language = " + language);
var usa = (language == "en-US");
var uk  = (language == "en-GB");
...

bmcpherson avatar Oct 26 '14 09:10 bmcpherson