CultureTypes Enumeration
Defines the types of culture lists that can be retrieved using CultureInfo.GetCultures.
This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
Namespace: System.GlobalizationAssembly: mscorlib (in mscorlib.dll)
| Member name | Description | |
|---|---|---|
![]() ![]() | NeutralCultures | Cultures 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 CultureInfo.GetCultures method that specifies this value. |
![]() ![]() | SpecificCultures | Cultures 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. |
![]() ![]() | InstalledWin32Cultures | All 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. |
![]() ![]() | AllCultures | All 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. |
| UserCustomCulture | Custom cultures created by the user. | |
| ReplacementCultures | Custom cultures created by the user that replace cultures shipped with the .NET Framework. | |
| WindowsOnlyCultures | Cultures installed in the Windows operating system but not the .NET Framework. The WindowsOnlyCultures value is mutually exclusive with the FrameworkCultures value. | |
| FrameworkCultures | Neutral and specific cultures shipped with the .NET Framework. |
These culture type values are returned by the CultureInfo.CultureTypes property, and also serve as a filter that limits the cultures returned by the CultureInfo.GetCultures 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.
The following code 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 Class Sample Public Shared 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 Class 'Sample 'The following is a portion of the results produced by this code example. '. '. '. 'Culture: syr ' NeutralCultures FrameworkCultures 'Culture: dv ' NeutralCultures FrameworkCultures 'Culture: ' SpecificCultures FrameworkCultures 'Culture: ar-SA ' SpecificCultures FrameworkCultures 'Culture: bg-BG ' SpecificCultures InstalledWin32Cultures FrameworkCultures 'Culture: ca-ES ' SpecificCultures InstalledWin32Cultures FrameworkCultures 'Culture: zh-TW ' SpecificCultures FrameworkCultures '. '. '.
The following code example displays several properties of the neutral cultures.
Imports System Imports System.Globalization Public Class SamplesCultureInfo Public Shared 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 End Class 'SamplesCultureInfo '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-CHS 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
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
