.NET Framework Class Library
CultureTypes Enumeration

Defines the types of culture lists that can be retrieved using the CultureInfoGetCultures method.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:   System.Globalization
Assembly:  mscorlib (in mscorlib.dll)
Syntax
<[%$TOPIC/9y39dxbc_en-us_VS_110_3_0_0_0_0%]> _
<[%$TOPIC/9y39dxbc_en-us_VS_110_3_0_0_0_1%]> _
<[%$TOPIC/9y39dxbc_en-us_VS_110_3_0_0_0_2%](True)> _
Public Enumeration CultureTypes
[[%$TOPIC/9y39dxbc_en-us_VS_110_3_0_1_0_0%]]
[[%$TOPIC/9y39dxbc_en-us_VS_110_3_0_1_0_1%]]
[[%$TOPIC/9y39dxbc_en-us_VS_110_3_0_1_0_2%](true)]
public enum CultureTypes
[[%$TOPIC/9y39dxbc_en-us_VS_110_3_0_2_0_0%]]
[[%$TOPIC/9y39dxbc_en-us_VS_110_3_0_2_0_1%]]
[[%$TOPIC/9y39dxbc_en-us_VS_110_3_0_2_0_2%](true)]
public enum class CultureTypes
[<[%$TOPIC/9y39dxbc_en-us_VS_110_3_0_3_0_0%]>]
[<[%$TOPIC/9y39dxbc_en-us_VS_110_3_0_3_0_1%]>]
[<[%$TOPIC/9y39dxbc_en-us_VS_110_3_0_3_0_2%](true)>]
type CultureTypes
public enum CultureTypes
Members
Member nameDescription
Supported by the XNA FrameworkAllCulturesAll cultures that ship with the .NET Framework, including neutral and specific cultures, cultures installed in the Windows operating system, and custom cultures created by the user.
FrameworkCulturesObsolete. This member is deprecated; using this value with CultureInfoGetCultures returns neutral and specific cultures shipped with the previous .NET Framework.
Supported by the XNA FrameworkInstalledWin32CulturesAll cultures that are installed in the Windows operating system. Note that not all cultures supported by the .NET Framework are installed in the operating system.
Supported by the XNA FrameworkNeutralCulturesCultures that are associated with a language but are not specific to a country/region. The names of .NET Framework cultures consist of the lowercase two-letter code derived from ISO 639-1. For example: "en" (English) is a neutral culture.

Custom cultures can have any user-specified name, not just a two-letter code.

The invariant culture is included in the array of cultures returned by the CultureInfoGetCultures method that specifies this value.

ReplacementCulturesCustom cultures created by the user that replace cultures shipped with the .NET Framework.
Supported by the XNA FrameworkSpecificCulturesCultures that are specific to a country/region. The names of these cultures follow RFC 4646 (Windows Vista and later). The format is "<languagecode2>-<country/regioncode2>", where <languagecode2> is a lowercase two-letter code derived from ISO 639-1 and <country/regioncode2> is an uppercase two-letter code derived from ISO 3166. For example, "en-US" for English (United States) is a specific culture.

Custom cultures can have any user-specified name, not just a standard-compliant name.

UserCustomCultureCustom cultures created by the user.
WindowsOnlyCulturesObsolete. This member is deprecated; the default behavior is set to return an empty list for backward compatibility reasons.
Remarks

These culture type values are returned by the CultureInfoCultureTypes property, and also serve as a filter that limits the cultures returned by the CultureInfoGetCultures method. For more information on cultures, see CultureInfo.

Generally, your application should enumerate all cultures, using the AllCultures value. This allows enumeration of custom cultures, as well as the other culture types.

Note that the FrameworkCultures and WindowsOnlyCultures members have been deprecated.

Examples

The following example demonstrates the CultureTypes enumeration and the CultureTypes property.

' This example demonstrates the CultureTypes enumeration  
' and the CultureInfo.CultureTypes property. 

Imports System
Imports System.Globalization

Module Module1
    Public Sub Main()

        ' Create a table of most culture types.  
        Dim mostCultureTypes() As CultureTypes = { _
                CultureTypes.NeutralCultures, _
                CultureTypes.SpecificCultures, _
                CultureTypes.InstalledWin32Cultures, _
                CultureTypes.UserCustomCulture, _
                CultureTypes.ReplacementCultures, _
                CultureTypes.FrameworkCultures, _
                CultureTypes.WindowsOnlyCultures}
        Dim allCultures() As CultureInfo
        Dim combo As CultureTypes

        ' Get and enumerate all cultures.
        allCultures = CultureInfo.GetCultures(CultureTypes.AllCultures)
        Dim ci As CultureInfo
        For Each ci In allCultures
            ' Display the name of each culture.
            Console.WriteLine("Culture: {0}", ci.Name)

            ' Get the culture types of each culture. 
            combo = ci.CultureTypes

            ' Display the name of each culture type flag that is set.
            Console.Write("  ")
            Dim ct As CultureTypes
            For Each ct In mostCultureTypes
                If 0 <> (ct And combo) Then
                    Console.Write("{0} ", ct)
                End If 
            Next ct
            Console.WriteLine()
        Next ci

    End Sub 'Main 
End Module 

'The following is a portion of the results produced by this code example. 
'. 
'. 
'. 
'Culture: tg 
'  NeutralCultures InstalledWin32Cultures  
'Culture: ta 
'  NeutralCultures InstalledWin32Cultures FrameworkCultures  
'Culture: te 
'  NeutralCultures InstalledWin32Cultures FrameworkCultures  
'Culture: syr 
'  NeutralCultures InstalledWin32Cultures FrameworkCultures  
'Culture: tg-Cyrl-TJ 
'  SpecificCultures InstalledWin32Cultures  
'Culture: ta-IN 
'  SpecificCultures InstalledWin32Cultures FrameworkCultures  
'Culture: te-IN 
'  SpecificCultures InstalledWin32Cultures FrameworkCultures  
'Culture: syr-SY 
'  SpecificCultures InstalledWin32Cultures FrameworkCultures  
'Culture: tg-Cyrl 
'  NeutralCultures InstalledWin32Cultures  
'. 
'. 
'.
// This example demonstrates the CultureTypes enumeration  
// and the CultureInfo.CultureTypes property. 

using System;
using System.Globalization;

class Sample
{
    public static void Main()
    {
        // Create a table of most culture types. 
        CultureTypes[] mostCultureTypes = new CultureTypes[] {
                        CultureTypes.NeutralCultures, 
                        CultureTypes.SpecificCultures, 
                        CultureTypes.InstalledWin32Cultures, 
                        CultureTypes.UserCustomCulture, 
                        CultureTypes.ReplacementCultures, 
                        CultureTypes.FrameworkCultures,
                        CultureTypes.WindowsOnlyCultures
                        };
        CultureInfo[] allCultures;
        CultureTypes combo;

        // Get and enumerate all cultures.
        allCultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
        foreach (CultureInfo ci in allCultures)
        {
            // Display the name of each culture.
            Console.WriteLine("Culture: {0}", ci.Name);

            // Get the culture types of each culture. 
            combo = ci.CultureTypes;

            // Display the name of each culture type flag that is set.
            Console.Write("  ");
            foreach (CultureTypes ct in mostCultureTypes)
                if (0 != (ct & combo))
                    Console.Write("{0} ", ct);
            Console.WriteLine();
        }
    }
}

/*
The following is a portion of the results produced by this code example.
.
.
.
Culture: tg
  NeutralCultures InstalledWin32Cultures 
Culture: ta
  NeutralCultures InstalledWin32Cultures FrameworkCultures 
Culture: te
  NeutralCultures InstalledWin32Cultures FrameworkCultures 
Culture: syr
  NeutralCultures InstalledWin32Cultures FrameworkCultures 
Culture: tg-Cyrl-TJ
  SpecificCultures InstalledWin32Cultures 
Culture: ta-IN
  SpecificCultures InstalledWin32Cultures FrameworkCultures 
Culture: te-IN
  SpecificCultures InstalledWin32Cultures FrameworkCultures 
Culture: syr-SY
  SpecificCultures InstalledWin32Cultures FrameworkCultures 
Culture: tg-Cyrl
  NeutralCultures InstalledWin32Cultures 
.
.
.
*/
// This example demonstrates the CultureTypes enumeration  
// and the CultureInfo.CultureTypes property. 

using namespace System;
using namespace System::Globalization;
int main()
{
    // Create a table of most culture types.  
    array<CultureTypes>^ mostCultureTypes = gcnew array<CultureTypes> {
                    CultureTypes::NeutralCultures, 
                    CultureTypes::SpecificCultures, 
                    CultureTypes::InstalledWin32Cultures, 
                    CultureTypes::UserCustomCulture, 
                    CultureTypes::ReplacementCultures, 
                    CultureTypes::FrameworkCultures,
                    CultureTypes::WindowsOnlyCultures
                    };
    CultureTypes combo;

    // Get and enumerate all cultures.
    System::Collections::IEnumerator^ enum0 = CultureInfo::GetCultures(CultureTypes::AllCultures)->GetEnumerator();
    while (enum0->MoveNext())
    {
        // Display the name of each culture.
        CultureInfo^ ci = safe_cast<CultureInfo^>(enum0->Current);
        Console::WriteLine("Culture: {0}", ci->Name);

        // Get the culture types of each culture. 
        combo = ci->CultureTypes;

        // Display the name of each culture type flag that is set.
        Console::Write("  ");
        for each (CultureTypes ct in mostCultureTypes)
            if ((ct & combo) != CultureTypes())
                Console::Write("{0} ", ct);
        Console::WriteLine();
    }
}

/*
The following is a portion of the results produced by this code example.
.
.
.
Culture: tg
  NeutralCultures InstalledWin32Cultures 
Culture: ta
  NeutralCultures InstalledWin32Cultures FrameworkCultures 
Culture: te
  NeutralCultures InstalledWin32Cultures FrameworkCultures 
Culture: syr
  NeutralCultures InstalledWin32Cultures FrameworkCultures 
Culture: tg-Cyrl-TJ
  SpecificCultures InstalledWin32Cultures 
Culture: ta-IN
  SpecificCultures InstalledWin32Cultures FrameworkCultures 
Culture: te-IN
  SpecificCultures InstalledWin32Cultures FrameworkCultures 
Culture: syr-SY
  SpecificCultures InstalledWin32Cultures FrameworkCultures 
Culture: tg-Cyrl
  NeutralCultures InstalledWin32Cultures 
.
.
.
*/

The following example displays several properties of the neutral cultures.

Imports System
Imports System.Globalization

Module Module1

   Public Sub Main()

      ' Displays several properties of the neutral cultures.
      Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME                              ENGLISHNAME")
      Dim ci As CultureInfo
      For Each ci In CultureInfo.GetCultures(CultureTypes.NeutralCultures)
         Console.Write("{0,-7}", ci.Name)
         Console.Write(" {0,-3}", ci.TwoLetterISOLanguageName)
         Console.Write(" {0,-3}", ci.ThreeLetterISOLanguageName)
         Console.Write(" {0,-3}", ci.ThreeLetterWindowsLanguageName)
         Console.Write(" {0,-40}", ci.DisplayName)
         Console.WriteLine(" {0,-40}", ci.EnglishName)
      Next ci

   End Sub 'Main 



'This code produces the following output.  This output has been cropped for brevity. 
' 
'CULTURE ISO ISO WIN DISPLAYNAME                              ENGLISHNAME 
'ar      ar  ara ARA Arabic                                   Arabic                                   
'bg      bg  bul BGR Bulgarian                                Bulgarian                                
'ca      ca  cat CAT Catalan                                  Catalan                                  
'zh-Hans zh  zho CHS Chinese (Simplified)                     Chinese (Simplified)                     
'cs      cs  ces CSY Czech                                    Czech                                    
'da      da  dan DAN Danish                                   Danish                                   
'de      de  deu DEU German                                   German                                   
'el      el  ell ELL Greek                                    Greek                                    
'en      en  eng ENU English                                  English                                  
'es      es  spa ESP Spanish                                  Spanish                                  
'fi      fi  fin FIN Finnish                                  Finnish                                  
'zh      zh  zho CHS Chinese                                  Chinese                                  
'zh-Hant zh  zho CHT Chinese (Traditional)                    Chinese (Traditional)                    
'zh-CHS  zh  zho CHS Chinese (Simplified) Legacy              Chinese (Simplified) Legacy              
'zh-CHT  zh  zho CHT Chinese (Traditional) Legacy             Chinese (Traditional) Legacy             

End Module
using System;
using System.Globalization;

public class SamplesCultureInfo
{

   public static void Main()
   {

      // Displays several properties of the neutral cultures.
      Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME                              ENGLISHNAME");
      foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.NeutralCultures))
      {
         Console.Write("{0,-7}", ci.Name);
         Console.Write(" {0,-3}", ci.TwoLetterISOLanguageName);
         Console.Write(" {0,-3}", ci.ThreeLetterISOLanguageName);
         Console.Write(" {0,-3}", ci.ThreeLetterWindowsLanguageName);
         Console.Write(" {0,-40}", ci.DisplayName);
         Console.WriteLine(" {0,-40}", ci.EnglishName);
      }

   }

}


/*
This code produces the following output.  This output has been cropped for brevity.

CULTURE ISO ISO WIN DISPLAYNAME                              ENGLISHNAME
ar      ar  ara ARA Arabic                                   Arabic                                  
bg      bg  bul BGR Bulgarian                                Bulgarian                               
ca      ca  cat CAT Catalan                                  Catalan                                 
zh-Hans zh  zho CHS Chinese (Simplified)                     Chinese (Simplified)                    
cs      cs  ces CSY Czech                                    Czech                                   
da      da  dan DAN Danish                                   Danish                                  
de      de  deu DEU German                                   German                                  
el      el  ell ELL Greek                                    Greek                                   
en      en  eng ENU English                                  English                                 
es      es  spa ESP Spanish                                  Spanish                                 
fi      fi  fin FIN Finnish                                  Finnish                                 
zh      zh  zho CHS Chinese                                  Chinese                                 
zh-Hant zh  zho CHT Chinese (Traditional)                    Chinese (Traditional)                   
zh-CHS  zh  zho CHS Chinese (Simplified) Legacy              Chinese (Simplified) Legacy             
zh-CHT  zh  zho CHT Chinese (Traditional) Legacy             Chinese (Traditional) Legacy            

*/
using namespace System;
using namespace System::Globalization;
int main()
{

   // Displays several properties of the neutral cultures.
   Console::WriteLine( "CULTURE ISO ISO WIN DISPLAYNAME                              ENGLISHNAME" );
   System::Collections::IEnumerator^ enum0 = CultureInfo::GetCultures( CultureTypes::NeutralCultures )->GetEnumerator();
   while ( enum0->MoveNext() )
   {
      CultureInfo^ ci = safe_cast<CultureInfo^>(enum0->Current);
      Console::Write( "{0,-7}", ci->Name );
      Console::Write( " {0,-3}", ci->TwoLetterISOLanguageName );
      Console::Write( " {0,-3}", ci->ThreeLetterISOLanguageName );
      Console::Write( " {0,-3}", ci->ThreeLetterWindowsLanguageName );
      Console::Write( " {0,-40}", ci->DisplayName );
      Console::WriteLine( " {0,-40}", ci->EnglishName );
   }
}

/*
This code produces the following output.  This output has been cropped for brevity.

CULTURE ISO ISO WIN DISPLAYNAME                              ENGLISHNAME
ar      ar  ara ARA Arabic                                   Arabic                                  
bg      bg  bul BGR Bulgarian                                Bulgarian                               
ca      ca  cat CAT Catalan                                  Catalan                                 
zh-Hans zh  zho CHS Chinese (Simplified)                     Chinese (Simplified)                    
cs      cs  ces CSY Czech                                    Czech                                   
da      da  dan DAN Danish                                   Danish                                  
de      de  deu DEU German                                   German                                  
el      el  ell ELL Greek                                    Greek                                   
en      en  eng ENU English                                  English                                 
es      es  spa ESP Spanish                                  Spanish                                 
fi      fi  fin FIN Finnish                                  Finnish                                 
zh      zh  zho CHS Chinese                                  Chinese                                 
zh-Hant zh  zho CHT Chinese (Traditional)                    Chinese (Traditional)                   
zh-CHS  zh  zho CHS Chinese (Simplified) Legacy              Chinese (Simplified) Legacy             
zh-CHT  zh  zho CHT Chinese (Traditional) Legacy             Chinese (Traditional) Legacy            

*/
Version Information

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0