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...
Status: RESOLVED DOWNSTREAM
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools (show other bugs)
Version: XI 11.0 (xcode9)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-10-02 10:39 UTC by Count Anthony Harrison
Modified: 2017-10-03 16:56 UTC (History)
2 users (show)

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


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

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);
            NSUserDefaults.StandardUserDefaults.Synchronize();

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

            #if ENABLE_TEST_CLOUD
            Xamarin.Calabash.Start();
            #endif

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
Hi,

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

Note You need to log in before you can comment on or make changes to this bug.