.NET API Documentation

Namespace: System.Globalization
This namespace contains types that define culture-sensitive information, such as language, country/region, and the calendar used.

Enumeration CultureTypes

Specifies flags that can be used to retrieve culture information.

public enum CultureTypes : int

Description

The CultureTypes enumeration is used with the GetCultures method to specify the types of cultures to retrieve. You can combine these enumeration values using the bitwise OR operator.

Members

Member Value Description
AllCultures 0x00000007 Retrieves all cultures, including user-defined cultures.
CoreCulture 0x00000001 Retrieves only the cultures that are part of the operating system's culture definitions. These are the cultures that are typically available to all applications on the system.
FrameworkCultures 0x00000002 Retrieves only the cultures that are installed as part of the .NET Framework. These cultures may include additional language packs or specific cultural settings not necessarily present in the operating system's default configuration.
NeutralCultures 0x00000004 Retrieves only the neutral cultures. Neutral cultures are cultures that do not have any specific region or language variations, and are used as base cultures for other cultures. For example, "en" is a neutral culture.
SpecificCultures 0x00000008 Retrieves only the specific cultures. Specific cultures are cultures that have a language and a region associated with them, such as "en-US" (English - United States) or "fr-FR" (French - France).
UserCustomCulture 0x00000010 Retrieves only the cultures that have been created by the user. These are cultures that are not part of the operating system or the .NET Framework by default but have been added by the user.

Remarks

The CultureTypes enumeration allows for flexible retrieval of culture information. For example, to get all cultures that are not user-defined, you can use the following combination:

CultureTypes.CoreCulture | CultureTypes.FrameworkCultures | CultureTypes.NeutralCultures | CultureTypes.SpecificCultures

This is equivalent to using CultureTypes.AllCultures minus CultureTypes.UserCustomCulture if the latter was a distinct concept. However, the most straightforward way to get all standard cultures is often to use CultureTypes.AllCultures.

Example Usage

// Get all cultures installed on the system
                CultureInfo[] allCultures = CultureInfo.GetCultures(CultureTypes.AllCultures);

                // Get only specific cultures (e.g., en-US, fr-FR)
                CultureInfo[] specificCultures = CultureInfo.GetCultures(CultureTypes.SpecificCultures);

                // Get core and framework cultures
                CultureInfo[] coreAndFramework = CultureInfo.GetCultures(CultureTypes.CoreCulture | CultureTypes.FrameworkCultures);