#1,120 – Getting a List of All Supported Cultures

You can get a full list of all cultures supported by .NET using the CultureInfo.GetCultures static method.  (In System.Globalization namespace).

Below is a code sample that dumps out a little bit of information about all known cultures.

            CultureInfo[] cultureList = CultureInfo.GetCultures(CultureTypes.AllCultures);
            foreach (CultureInfo ci in cultureList.OrderBy(cult => cult.Name))
            {
                if (ci.IsNeutralCulture)
                    Console.WriteLine("{0} (neutral) - {1}", ci.Name, ci.EnglishName);
                else
                    Console.WriteLine("{0} - {1}", ci.Name, ci.EnglishName);
            }

1120-001

#1,114 – Culture Codes

In developing applications for Windows, a culture can be thought of as the combination of a particular language and the country or region where the language is being spoken.

Examples of specific cultures, representing a language and a region, include:

  • English / United States
  • English / United Kingdom
  • French / Belgium
  • French / France
  • German / Germany

Examples of neutral cultures, with no specific culture, include:

  • English
  • French
  • German

Cultures are represented in WPF by the use of culture codes or language tags, which conform to RFC 4646.  A language tag is composed of a code representing the language and a code representing the country or region, separated by a hyphen.

Below are several examples of names for specific cultures:

  • en-US  (English / United States)
  • en-GB  (English / United Kingdom)
  • fr-BE  (French / Belgium)
  • fr-FR  (French / France)
  • de-DE  (German / Germany)

A neutral culture is represented by the code for the language, by itself:

  • en  (English)
  • fr  (French)
  • de  (German)