ui-screen-shooter
ui-screen-shooter copied to clipboard
Region/Locale not set properly in XCode6
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.
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.
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");
...