Company-Specific Dialects


As mentioned in "Uses for Custom Cultures," at the beginning of this chapter, it can be useful to create a set of resources that use a vocabulary that is specific to a single company or group of companies. The CreateChildCultureAndRegionInfoBuilder method does just this and can be used like this:

 CultureAndRegionInfoBuilder builder =     CultureAndRegionInfoBuilderHelper.     CreateChildCultureAndRegionInfoBuilder(     new CultureInfo("en-US"),     "en-US-Sirius",     "English (United States) (Sirius Minor Publications)",     "English (United States) (Sirius Minor Publications)",     "United States (Sirius Minor Publications)",     "United States (Sirius Minor Publications)"); builder.Register(); 


The method accepts a culture (e.g., "en-US") to inherit from, and accepts the new culture name and various strings to set various name properties to. It returns a CultureAndRegionInfoBuilder object that can be used to register the culture. The CreateChildCultureAndRegionInfoBuilder method follows:

 public static CultureAndRegionInfoBuilder     CreateChildCultureAndRegionInfoBuilder(     CultureInfo parentCultureInfo, string cultureName,     string cultureEnglishName, string cultureNativeName,     string regionEnglishName, string regionNativeName) {     RegionInfo parentRegionInfo =        new RegionInfo(parentCultureInfo.Name);     CultureAndRegionInfoBuilder builder =         new CultureAndRegionInfoBuilder(cultureName,         CultureAndRegionModifiers.None);     // load the culture and region data from the parent     builder.LoadDataFromCultureInfo(parentCultureInfo);     builder.LoadDataFromRegionInfo(parentRegionInfo);     builder.Parent = parentCultureInfo;     builder.CultureEnglishName = cultureEnglishName;     builder.CultureNativeName = cultureNativeName;     builder.RegionEnglishName = regionEnglishName;     builder.RegionNativeName = regionNativeName;     return builder; } 





.NET Internationalization(c) The Developer's Guide to Building Global Windows and Web Applications
.NET Internationalization: The Developers Guide to Building Global Windows and Web Applications
ISBN: 0321341384
EAN: 2147483647
Year: 2006
Pages: 213

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net