4.4. Globalization

Globalization is becoming increasingly important in application development. The .NET 4.0 Framework now supports a minimum of 354 cultures (compared with 203 in previous releases with new support for Eskimos/Inuits—and a whole lot more).

A huge amount of localization information is compiled into the .NET Framework. The main problem is that the .NET Framework doesn't get updated that often, and native code doesn't use the same localization info.

This changes in .NET 4.0 for Windows 7 users because globalization information is read directly from the operating system rather than the framework. This is a good move because it presents a consistent approach across managed/unmanaged applications. For users not lucky enough to be using Windows 7 (it's good; you should upgrade), globalization information will be read from the framework itself as per usual. Note that Windows Server 2008 will still use the localized .NET 4.0 store.

4.4.1. Globalization Changes in .NET 4.0

There have been a huge number of globalization changes; many of them will affect only a minority of users. For a full list, please refer to http://msdn.microsoft.com/en-us/netframework/dd890508.aspx.

Next, I want to draw your attention to some of the changes in .NET 4.0:

  • Neutral culture properties will return values from the specific culture that is most dominant for that neutral culture.

  • Neutral replacement cultures created by .NET 2.0 will not load in .NET 4.0.

  • Resource Manager will now refer to the user's preferred UI language instead of that specified in the CurrentUICultures parent chain.

  • .NET 4.0 provides the ability to opt in to previous framework versions' globalization-sorting capabilities.

  • The zh-HK_stroke, ja-JP_unicod, and ko-KR_unicod alternate sort locales have been removed.

  • .NET 4.0 is compliant with Unicode standard 5.1 (which required the addition of about 1,400 characters).

  • Support has been added for the following scripts: Sundanese, Lepcha, Ol Chiki, Vai, Saurashtra, Kayah Li, Rejang, and Cham.

  • Some cultures display names changed to follow naming convention guidelines: Chinese, Tibetan (PRC), French (Monaco), Tamazight (Latin, Algeria), and Spanish (Spain, International Sort).

  • The parent chain of Chinese cultures now includes the root Chinese culture.

  • The Arabic locale calendar data has been updated.

  • The culture types WindowsOnlyCultures and FrameworkCultures are now obsolete.

  • CompareInfo.ToString() and TextInfo.ToString() will not return locale IDs because Microsoft wants to reduce this usage.

  • Miscellaneous updates have been made to globalization properties such as currency, date and time formats, and number formatting.

4.4.2. TimeSpan Globalized Formatting and Parsing

TimeSpan now has new overloaded versions of ToString(), Parse(), TryParse(), ParseExact(), and TryParseExact() to support culture-sensitive formatting. Previously, TimeSpan's ToString() method would ignore culture settings on Arabic machines, for example.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.18.101