X hits on this document

157 views

0 shares

0 downloads

0 comments

39 / 67

CUSTOM CULTURES

builder.CompareInfo = CompareInfo.GetCompareInfo(0x0000040A);

builder.Register();

The assignment to CompareInfo throws a NotSupportedException. Therefore, a benefit of using a supplemental custom culture instead of a replacement culture is that these properties can have different values than those of the original culture.

In addition to the public properties in Table 11.3 the LoadDataFromCultureInfo method sets internal values for DurationFormats, FontSignature, and Paper- Size. These values are used in the LDML file created by the Save method. The LoadDataFromCultureInfo method represents the only way to set these proper- ties.

The resulting supplemental custom culture does not have the complete func- tionality of the replacement custom culture. One difference lies in the behavior of the CultureInfo.DisplayName property. This property has a certain level of intelli- gence built into it. The DisplayName property returns the name of the culture for the CurrentCulture for built-in .NET Framework and Windows cultures. This means that the DisplayName for the fr-FR culture is “French (France)” when the Cur- rentCulture is “en-US”, but it is “Français (France)” and “Französisch (Frankreich)” when the CurrentCulture is “fr-FR” and “de-DE”, respectively, and the French and German .NET Framework Language Packs have been installed. Replacement cultures adopt the same functionality because the .NET Framework can identify that the culture is known. The same functionality is not available to sup- plemental custom cultures because the .NET Framework cannot and should not guess at the correct DisplayName. Consequently, the DisplayName of a supple- mental custom culture is the same as the native name. Table 11.5 shows the difference in behavior for a tr-TR (Turkish (Turkey) custom culture.

CurrentCulture

tr-TR Replacement Culture DisplayName

tr-TR Supplemental Culture DisplayName

en-US

Turkish (Turkey)

Türkçe (Türkiye)

tr-TR

Türkçe (Türkiye)

Türkçe (Türkiye)

Table 11.5

CultureInfo.DisplayName Behavioral Difference for Replacement and Supplemental Custom Cultures

15

Document info
Document views157
Page views157
Page last viewedTue Dec 06 08:53:51 UTC 2016
Pages67
Paragraphs859
Words13458

Comments