Cultures Generated from Windows Locales
Globalization support in the .NET Framework automatically creates a culture that corresponds to a Windows locale, if such a culture does not exist in the .NET Framework.
Generated Cultures
Windows ships with a set of locales, which are equivalent to .NET Framework cultures, that specify culture-specific information such as how text is sorted, how a date is formatted, and the display format of numbers and currency. Windows also supports a feature called the Enabled Languages Kit (ELK) that enables the addition of new locales without requiring a new operating system release. As a result, you can add a locale to Windows that does not correspond to a culture in the .NET Framework.
If your application tries to create a CultureInfo object for a culture that does not exist in the .NET Framework, and a corresponding locale exists in Windows, the .NET Framework automatically creates a new culture based on the Windows locale. The new culture is created when you specify its name or LCID, and can be used like any other .NET Framework culture.
The name of a generated culture consists of its ISO 639 language code, ISO 3166 country/region code, and an optional ISO 15924 script tag for the written language. For example, the name of the culture where the language is Bosnian, as used in the Bosnia and Herzegovina region and written in Latin script, is bs-Latn-BA.
Performance Considerations
A culture generated from a Windows locale is created the first time the CultureInfo constructor is called for that culture, and the creation process is time consuming. However, subsequent culture objects are created without a performance penalty.
Serializing and deserializing a culture is the process of creating a binary representation of a CultureInfo object, then using that binary representation to reconstitute the original CultureInfo object. You can serialize a culture on one computer and deserialize it on another. However, if you serialize a culture derived from an ELK locale on one computer, an exception is thrown if you deserialize the binary representation on another computer that does not have the same ELK locale installed.
Default Values
Data from a Windows locale is used to populate the corresponding property of a CultureInfo object created from that locale. If there is no corresponding locale data, the property is populated with a default value.
The return value of many CultureInfo methods and some properties depends on culture-specific data. If the Windows locale does not provide culture-specific data for the generated culture, data is derived from a default culture. In most cases, the default culture is the invariant culture.
The following table lists the default value for the properties, and the default culture for the methods, of the CultureInfo, RegionInfo, NumberFormatInfo, CompareInfo, TextInfo, and Calendar classes that support a .NET Framework culture.
CultureInfo
Member | Default |
---|---|
IsNeutralCulture |
false, because Windows does not have neutral cultures. |
Parent |
Invariant culture, because Windows does not have neutral cultures. |
GetConsoleFallbackUICulture |
Invariant culture. |
RegionInfo
Member | Default |
---|---|
GeoId |
Zero for Windows 2000; inherited from Windows XP and later. |
DateTimeFormatInfo
Member | Default |
---|---|
GetAbbreviatedEraName |
Invariant culture. |
GetEra |
Invariant culture. |
GetEraName |
Invariant culture. |
MonthDayPattern |
Invariant culture. |
NativeCalendarName |
Invariant culture. |
NumberFormatInfo
Member | Default |
---|---|
NaNSymbol |
Invariant culture. |
NegativeInfinitySymbol |
Invariant culture. |
PercentDecimalDigits |
Invariant culture. |
PercentDecimalSeparator |
Invariant culture. |
PercentGroupSeparator |
Invariant culture. |
PercentGroupSizes |
Invariant culture. |
PercentNegativePattern |
Invariant culture. |
PercentPositivePattern |
Invariant culture. |
PercentSymbol |
Invariant culture. |
PerMilleSymbol |
Invariant culture. |
PositiveInfinitySymbol |
Invariant culture. |
CompareInfo
Member | Default |
---|---|
IndexOf |
(none) |
IsPrefix |
(none) |
IsSuffix |
(none) |
LastIndexOf |
(none) |
TextInfo
Member | Default |
---|---|
ToTitleCase |
The same result as for the en-US culture, unless the Windows locale ANSI code page is Turkish. In this case, the default is the same result as for the tr-TR culture. |
Calendar
Member | Default |
---|---|
All |
The corresponding member of the calendar returned by InvariantCulture. |
Culture Names for Recent ELK Versions
Create cultures by specifying the culture name or culture identifier (LCID) of the culture in a CultureInfo constructor. The following table lists the culture name, culture identifier, English name, ISO 639 language code, and ISO 3166 country/region code for Windows locales shipped in ELK version 1 and 2.
Culture Name | Culture Identifier | English Name | ISO 639 code (language) | ISO 3166 code (country/region) |
---|---|---|---|---|
arn-CL |
047A |
Mapudungun (Chile) |
arn |
CL |
bn-IN |
0445 |
Bengali (India) |
bn |
IN |
bs-Cyrl-BA |
201A |
Bosnian (Bosnia and Herzegovina, Cyrillic) |
bs |
BA |
bs-Latn-BA |
141A |
Bosnian (Bosnia and Herzegovina, Latin) |
bs |
BA |
cy-GB |
0452 |
Welsh (United Kingdom) |
cy |
GB |
gbz-AF |
047F |
Dari (Afghanistan) |
fa |
AF |
fil-PH |
0464 |
Filipino (Philippines) |
fil |
PH |
ga-IE |
043C |
Irish (Ireland) |
ga |
IE |
hr-BA |
101A |
Croatian (Bosnia and Herzegovina) |
hr |
BA |
iu-Latn-CA |
085D |
Inuktitut (Canada, Latin) |
iu |
CA |
lb-LU |
046E |
Luxembourgish (Luxembourg) |
lb |
LU |
mi-NZ |
0481 |
Maori (New Zealand) |
mi |
NZ |
ml-IN |
044C |
Malayalam (India) |
ml |
IN |
moh-CA |
047C |
Mohawk (Canada) |
moh |
CA |
mt-MT |
043A |
Maltese (Malta) |
mt |
MT |
ne-NP |
0461 |
Nepali (Nepal) |
ne |
NP |
ns-ZA |
046C |
Sesotho sa Leboa/Northern Sotho (South Africa) |
nso |
ZA |
ps-AF |
0463 |
Pashto (Afghanistan) |
ps |
AF |
quz-BO |
046B |
Quechua (Bolivia) |
quz |
BO |
quz-EC |
086B |
Quechua (Ecuador) |
quz |
EC |
quz-PE |
0C6B |
Quechua (Peru) |
quz |
PE |
rm-CH |
0417 |
Romansh (Switzerland) |
rm |
CH |
se-FI |
0C3B |
Sami (Northern, Finland) |
se |
FI |
se-NO |
043B |
Sami (Northern, Norway) |
se |
NO |
se-SE |
083B |
Sami (Northern, Sweden) |
se |
SE |
sma-NO |
183B |
Sami (Southern, Norway) |
sma |
NO |
sma-SE |
1C3B |
Sami (Southern, Sweden) |
sma |
SE |
smj-NO |
103B |
Sami (Lule, Norway) |
smj |
NO |
smj-SE |
143B |
Sami (Lule, Sweden) |
smj |
SE |
smn-FI |
243B |
Sami (Inari, Finland) |
smn |
FI |
sms-FI |
203B |
Sami (Skolt, Finland) |
sms |
FI |
sr-Cyrl-BA |
1C1A |
Serbian (Bosnia and Herzegovina, Cyrillic) |
sr |
BA |
sr-Latn-BA |
181A |
Serbian (Bosnia and Herzegovina, Latin) |
sr |
BA |
tn-ZA |
0432 |
Setswana/Tswana (South Africa) |
tn |
ZA |
wen-DE |
042E |
Upper Sorbian (Germany) |
wen |
DE |
xh-ZA |
0434 |
Xhosa/isiZhosa (South Africa) |
xh |
ZA |
zu-ZA |
0435 |
Zulu/isiZulu (South Africa) |
zu |
ZA |
See Also
Tasks
How to: Create Custom Cultures