Bug 59887 - Localisation via use of 'AppleLanguages' string fails when declared in AppDelegate but followed by Xamarin.Calabash.Start()
Summary: Localisation via use of 'AppleLanguages' string fails when declared in AppDel...
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: XI 11.0 (xcode9)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2017-10-02 10:39 UTC by Count Anthony Harrison
Modified: 2017-10-03 16:56 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

AppDelegate Screenshot (138.81 KB, image/png)
2017-10-02 10:39 UTC, Count Anthony Harrison

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Count Anthony Harrison 2017-10-02 10:39:26 UTC
Created attachment 25051 [details]
AppDelegate Screenshot

When placing the following code in AppDelegate at the start of the FinishedLaunching(...) method, despite that my Simulator is in EN, the app displays DE localisation strings. This is the behaviour I want:

            var key = new NSString("AppleLanguages");
            string[] languageValues = { "de" };
            NSUserDefaults.StandardUserDefaults.SetValueForKey(NSArray.FromObjects(languageValues), key);

However, when I add the following UITest code snippet straight after it, the DE localisations fail to load:

            #if ENABLE_TEST_CLOUD

The advantage of being able to force the Simulator to display any localisation during an overnight BDD run means that every morning we can distribute all the localisations to all of the country marketing managers.

However the bug here is that the inclusion of UITest artefacts prevents the ordinary operation of the simulator (and presumably, a device).

The attachment shows 'Xamarin.Calabash.Start()' commented out and which produces a successful DE localised screenshot on the simulator (iPhone X on OSX 11).

Uncommenting that line results in an unwanted EN localisation.
Comment 1 Count Anthony Harrison 2017-10-02 11:04:34 UTC
The same failure occurs if the code is placed after Xamarin.Calabash.Start().
Comment 2 Vincent Dondain [MSFT] 2017-10-03 16:44:21 UTC

Even though you might only be hitting this issue locally, we research & triage Xamarin.UITest issues through the Test Cloud support channels because there’s a lot of crossover between the testing platform and testing frameworks.

You can reach out to support by logging into testcloud.xamarin.com & clicking on “Support” in the menubar: http://content.screencast.com/users/Kent.Green/folders/Jing/media/572442e2-c82c-4a25-9a30-1f594f156dd7/00000323.png