Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
On Windows Phone and Android, everything is fine. However, testing in the iOS Simulator, the code for detecting the language is not picking up the preferred languages (the code used is as per samples/documentation).
This is what I am using:
var netLanguage = "en";
if (NSLocale.PreferredLanguages.Length > 0)
var pref = NSLocale.PreferredLanguages ;
netLanguage = pref.Replace ("_", "-");
return new System.Globalization.CultureInfo(netLanguage);
However, the PreferredLanguages collection is coming back empty. If I hack this and set the netLanguage to the appropriate value (e.g. "nl") then I can test the rest of my app, but this code (obtained from samples/documentation) is not picking up the language correctly.
I don't know if this is an issue in the simulator, or is an issue in the sample code/documentation.
Provided code looks good for me. NSLocale.PreferredLanguages should hold at least one element (current language). I am pretty sure that this is iOS8 simulator issue
We should just await fix from Apple
I've just re-tested this, on both simulator and physical device. It is working now (and may have been for some time)