C # getCultures in local / currentCulture

The following code returns English names, despite the fact that I localized the current culture.

List<string> languageList = new List<string>(); CultureInfo[] cultureList = CultureInfo.GetCultures(CultureTypes.AllCultures); foreach (CultureInfo culture in cultureList) { languageList.Add(culture.DisplayName); } 

What if I want the display names to appear in Italian, or in German, or in any other language that I specify? Any suggestions?

+4
source share
2 answers

You must use the NativeName property NativeName

Look at this question also. How to translate CultureInfo language names

+3
source

The DisplayName property returns the name of the culture in the language of the localized version of the .NET Framework:

This property is the localized name from the version of the .NET Framework. For example, if the .NET Framework English version is installed, the property return is "English (United States)" for the en-US culture name. If the Spanish version of the .NET Framework is installed regardless of the language in which the mapping system is installed, the Spanish culture name is displayed and the property for en-US returned to "Ingados (Estados Unidos)".

Use the NativeName property instead . However, note that you cannot get the name of the culture in a language other than its own (except, of course, English and the language of your version of the .NET Framework).

+4
source

All Articles