Robert W
Robert W

Reputation: 2961

Get culture name from cultureCode

Is there a built in method in .NET to convert a culture code into a user-friendly name? E.g:

Upvotes: 8

Views: 3678

Answers (2)

ba__friend
ba__friend

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

Dummy01
Dummy01

Reputation: 1995

string displayName;

CultureInfo cultureInfo = CultureInfo.GetCultureInfo("fo-FO");

displayName = cultureInfo.DisplayName;

EDIT:

Removed if (culture != null).

Upvotes: 1

Related Questions