Reputation: 2961
Is there a built in method in .NET to convert a culture code into a user-friendly name? E.g:
Upvotes: 8
Views: 3678
Reputation: 5903
CultureInfo
has a property called DisplayName
var culture = CultureInfo.GetCultureInfo("en-GB");
var displayName = culture.DisplayName;
DisplayName
gives you a localized version of the name.
There is also a EnglishName
property. ;)
Upvotes: 13
Reputation: 1995
string displayName;
CultureInfo cultureInfo = CultureInfo.GetCultureInfo("fo-FO");
displayName = cultureInfo.DisplayName;
EDIT:
Removed if (culture != null)
.
Upvotes: 1