Created
July 30, 2012 10:22
-
-
Save deanhume/3206032 to your computer and use it in GitHub Desktop.
Retrieve a list of Country names and culture defaults
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dictionary<string, string> cultureDetails = new Dictionary<string, string>(); | |
foreach (CultureInfo cultureInfo in CultureInfo.GetCultures(CultureTypes.SpecificCultures)) | |
{ | |
RegionInfo regionInfo = new RegionInfo(cultureInfo.Name); | |
if (!cultureDetails.ContainsKey(regionInfo.EnglishName)) | |
{ | |
cultureDetails.Add(regionInfo.EnglishName, regionInfo.Name); | |
} | |
} | |
var orderedCultureDetails = cultureDetails.OrderBy(x => x.Key); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment