Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Globalization.​CultureInfo
Assembly: System.Runtime
Inheritance: object → CultureInfo
Implemented Interfaces
Provides information about a specific culture (called a locale for unmanaged code development). The information includes the names for the culture, the writing system, the calendar used, the sort order of strings, and formatting for dates and numbers.
Properties
public
Calendar
Calendar
Gets the default calendar used by the culture.
public
CompareInfo
CompareInfo
Gets the <see cref="T:System.Globalization.CompareInfo" /> that defines how to compare strings for the culture.
public
CultureTypes
CultureTypes
Gets the culture types that pertain to the current <see cref="T:System.Globalization.CultureInfo" /> object.
public static
CultureInfo
CurrentCulture
Gets or sets the <see cref="T:System.Globalization.CultureInfo" /> object that represents the culture used by the current thread and task-based asynchronous operations.
public static
CultureInfo
CurrentUICulture
Gets or sets the <see cref="T:System.Globalization.CultureInfo" /> object that represents the current user interface culture used by the Resource Manager to look up culture-specific resources at run time.
public
DateTimeFormatInfo
DateTimeFormat
Gets or sets a <see cref="T:System.Globalization.DateTimeFormatInfo" /> that defines the culturally appropriate format of displaying dates and times.
public static
CultureInfo
DefaultThreadCurrentCulture
Gets or sets the default culture for threads in the current application domain.
public static
CultureInfo
DefaultThreadCurrentUICulture
Gets or sets the default UI culture for threads in the current application domain.
public
string
DisplayName
Gets the full localized culture name.
public
string
EnglishName
Gets the culture name in the format languagefull [country/regionfull] in English.
public
string
IetfLanguageTag
Deprecated. Gets the RFC 4646 standard identification for a language.
public static
CultureInfo
InstalledUICulture
Gets the <see cref="T:System.Globalization.CultureInfo" /> that represents the culture installed with the operating system.
public static
CultureInfo
InvariantCulture
Gets the <see cref="T:System.Globalization.CultureInfo" /> object that is culture-independent (invariant).
public
bool
IsNeutralCulture
Gets a value indicating whether the current <see cref="T:System.Globalization.CultureInfo" /> represents a neutral culture.
public
bool
IsReadOnly
Gets a value indicating whether the current <see cref="T:System.Globalization.CultureInfo" /> is read-only.
public
int
KeyboardLayoutId
Gets the active input locale identifier.
public
int
LCID
Gets the culture identifier for the current <see cref="T:System.Globalization.CultureInfo" /> .
public
string
Name
Gets the culture name in the format languagecode2-country/regioncode2.
public
string
NativeName
Gets the culture name, consisting of the language, the country/region, and the optional script, that the culture is set to display.
public
NumberFormatInfo
NumberFormat
Gets or sets a <see cref="T:System.Globalization.NumberFormatInfo" /> that defines the culturally appropriate format of displaying numbers, currency, and percentage.
public
Calendar[]
OptionalCalendars
Gets the list of calendars that can be used by the culture.
public
CultureInfo
Parent
Gets the <see cref="T:System.Globalization.CultureInfo" /> that represents the parent culture of the current <see cref="T:System.Globalization.CultureInfo" /> .
public
TextInfo
TextInfo
Gets the <see cref="T:System.Globalization.TextInfo" /> that defines the writing system associated with the culture.
public
string
ThreeLetterISOLanguageName
Gets the ISO 639-2 three-letter code for the language of the current <see cref="T:System.Globalization.CultureInfo" /> .
public
string
ThreeLetterWindowsLanguageName
Gets the three-letter code for the language as defined in the Windows API.
public
string
TwoLetterISOLanguageName
Gets the ISO 639-1 two-letter or ISO 639-3 three-letter code for the language of the current <see cref="T:System.Globalization.CultureInfo" /> .
public
bool
UseUserOverride
Gets a value indicating whether the current <see cref="T:System.Globalization.CultureInfo" /> object uses the user-selected culture settings.
Methods
public
void
ClearCachedData​()
Refreshes cached culture-related information.
public
object
Clone​()
Creates a copy of the current <see cref="T:System.Globalization.CultureInfo" /> .
Returns A copy of the current <see cref="T:System.Globalization.CultureInfo" /> .
public static
CultureInfo
CreateSpecificCulture​(string name)
Creates a <see cref="T:System.Globalization.CultureInfo" /> that represents the specific culture that is associated with the specified name.
Returns A <see cref="T:System.Globalization.CultureInfo" /> object that represents:
The invariant culture, if <paramref name="name" /> is an empty string ("").
-or-
The specific culture associated with <paramref name="name" /> , if <paramref name="name" /> is a neutral culture.
-or-
The culture specified by <paramref name="name" /> , if <paramref name="name" /> is already a specific culture.
name
A predefined <see cref="T:System.Globalization.CultureInfo" /> name or the name of an existing <see cref="T:System.Globalization.CultureInfo" /> object. <paramref name="name" /> is not case-sensitive.
public
bool
Equals​(object value)
Determines whether the specified object is the same culture as the current <see cref="T:System.Globalization.CultureInfo" /> .
Returns <see langword="true" /> if <paramref name="value" /> is the same culture as the current <see cref="T:System.Globalization.CultureInfo" /> ; otherwise, <see langword="false" /> .
value
The object to compare with the current <see cref="T:System.Globalization.CultureInfo" /> .
public
CultureInfo
GetConsoleFallbackUICulture​()
Gets an alternate user interface culture suitable for console applications when the default graphic user interface culture is unsuitable.
Returns An alternate culture that is used to read and display text on the console.
public static
CultureInfo
GetCultureInfo​(int culture)
Retrieves a cached, read-only instance of a culture by using the specified culture identifier.
Returns A read-only <see cref="T:System.Globalization.CultureInfo" /> object.
culture
A locale identifier (LCID).
public static
CultureInfo
GetCultureInfo​(string name)
Retrieves a cached, read-only instance of a culture using the specified culture name.
Returns A read-only <see cref="T:System.Globalization.CultureInfo" /> object.
name
The name of a culture. <paramref name="name" /> is not case-sensitive.
public static
CultureInfo
GetCultureInfo​(string name,
bool predefinedOnly)
Retrieves a cached, read-only instance of a culture.
Returns A read-only instance of a culture.
name
The name of a culture. It is not case-sensitive.
predefinedOnly
<see langword="true" /> if requesting to create an instance of a culture that is known by the platform. <see langword="false" /> if it is ok to retreive a made-up culture even if the platform does not carry data for it.
public static
CultureInfo
GetCultureInfo​(string name,
string altName)
Retrieves a cached, read-only instance of a culture. Parameters specify a culture that is initialized with the <see cref="T:System.Globalization.TextInfo" /> and <see cref="T:System.Globalization.CompareInfo" /> objects specified by another culture.
Returns A read-only <see cref="T:System.Globalization.CultureInfo" /> object.
name
The name of a culture. <paramref name="name" /> is not case-sensitive.
altName
The name of a culture that supplies the <see cref="T:System.Globalization.TextInfo" /> and <see cref="T:System.Globalization.CompareInfo" /> objects used to initialize <paramref name="name" /> . <paramref name="altName" /> is not case-sensitive.
public static
CultureInfo
GetCultureInfoByIetfLanguageTag​(string name)
Deprecated. Retrieves a read-only <see cref="T:System.Globalization.CultureInfo" /> object having linguistic characteristics that are identified by the specified RFC 4646 language tag.
Returns A read-only <see cref="T:System.Globalization.CultureInfo" /> object.
name
The name of a language as specified by the RFC 4646 standard.
public static
CultureInfo[]
GetCultures​(CultureTypes types)
Gets the list of supported cultures filtered by the specified <see cref="T:System.Globalization.CultureTypes" /> parameter.
Returns An array that contains the cultures specified by the <paramref name="types" /> parameter. The array of cultures is unsorted.
types
A bitwise combination of the enumeration values that filter the cultures to retrieve.
public
object
GetFormat​(Type formatType)
Gets an object that defines how to format the specified type.
Returns The value of the <see cref="P:System.Globalization.CultureInfo.NumberFormat" /> property, which is a <see cref="T:System.Globalization.NumberFormatInfo" /> containing the default number format information for the current <see cref="T:System.Globalization.CultureInfo" /> , if <paramref name="formatType" /> is the <see cref="T:System.Type" /> object for the <see cref="T:System.Globalization.NumberFormatInfo" /> class.
-or-
The value of the <see cref="P:System.Globalization.CultureInfo.DateTimeFormat" /> property, which is a <see cref="T:System.Globalization.DateTimeFormatInfo" /> containing the default date and time format information for the current <see cref="T:System.Globalization.CultureInfo" /> , if <paramref name="formatType" /> is the <see cref="T:System.Type" /> object for the <see cref="T:System.Globalization.DateTimeFormatInfo" /> class.
-or-
null, if <paramref name="formatType" /> is any other object.
formatType
The <see cref="T:System.Type" /> for which to get a formatting object. This method only supports the <see cref="T:System.Globalization.NumberFormatInfo" /> and <see cref="T:System.Globalization.DateTimeFormatInfo" /> types.
public
int
GetHashCode​()
Serves as a hash function for the current <see cref="T:System.Globalization.CultureInfo" /> , suitable for hashing algorithms and data structures, such as a hash table.
Returns A hash code for the current <see cref="T:System.Globalization.CultureInfo" /> .
public static
CultureInfo
ReadOnly​(CultureInfo ci)
Returns a read-only wrapper around the specified <see cref="T:System.Globalization.CultureInfo" /> object.
Returns A read-only <see cref="T:System.Globalization.CultureInfo" /> wrapper around <paramref name="ci" /> .
ci
The <see cref="T:System.Globalization.CultureInfo" /> object to wrap.
public
string
ToString​()
Returns a string containing the name of the current <see cref="T:System.Globalization.CultureInfo" /> in the format languagecode2-country/regioncode2.
Returns A string containing the name of the current <see cref="T:System.Globalization.CultureInfo" /> .
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .