Get culture name from cultureCode

Is there a built-in method in .NET to convert culture code to a user-friendly name? For example:

  • en-GB - English - United Kingdom
  • et-EE - Estonia - Estonia
  • pa-IN - Punjabi - India
  • fo-FO - Faroe Islands - Faroe Islands
+8
source share
2 answers

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 an EnglishName property EnglishName )

+13
source
 string displayName; CultureInfo cultureInfo = CultureInfo.GetCultureInfo("fo-FO"); displayName = cultureInfo.DisplayName; 

EDIT:

Removed if (culture != null) .

+1
source

All Articles