Reputation: 14835
Here is the iOS code I have:
[[[NSLocale currentLocale] localeIdentifier] isEqualToString:@"en_US"]
Is there anything similar on the Windows Phone 7 C# side to find out what locality the user has chosen on their device?
Upvotes: 1
Views: 148
Reputation: 12465
I'm guessing you would want to use
System.Globalization.CultureInfo.CurrentCulture
or
System.Globalization.CultureInfo.CurrentUICulture
You can test for "en_US" with the IetfLanguageTag
property
System.Globalization.CultureInfo.CurrentCulture.IetfLanguageTag == "en_US"
Upvotes: 1
Reputation: 14835
Someone please confirm this, but here's what I think the answer may be:
if (CultureInfo.CurrentCulture.Name.ToString() == "en-US")
Upvotes: 0