Bug 45239 - NSLocale.PreferredLanguages return incorrect value
Summary: NSLocale.PreferredLanguages return incorrect value
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 10.0 (iOS10)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-10-10 14:25 UTC by nicolas.esprit.bdl
Modified: 2016-10-12 12:57 UTC (History)
3 users (show)

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

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:
Status:
RESOLVED ANSWERED

Description nicolas.esprit.bdl 2016-10-10 14:25:19 UTC
If the phone has Lëtzebuergesch as prefered language and any other as Iphone Language (French or English), NSLocale.PreferredLanguages return "lb-US" ?
Comment 1 Sebastien Pouliot 2016-10-12 12:57:39 UTC
This value comes directly from iOS and is not modified by Xamarin.

You get the language code (first 2 chars) and a region (last 2 chars). It does not behave identically to the CultureInfo found in .NET, where both information needs to match a known entry, so you can end up with "uncommon", but valid, patterns.

It looks like your phone is currently set for "Lëtzebuergesch" with the region set of the USA.