X hits on this document





28 / 67



as the pseudo translation culture. In this chapter, we create a custom culture that exists exclusively to support a pseudo translation.

Finally, another common use for custom cultures is to support commercial dialects. In this scenario, you want to ship an application in a single language, such as English, but the words and phrases used by one customer or group of customers differ from the words and phrases used by a different customer or group of cus- tomers. This is more common than it sounds. The accounting industry, for example, suffers this dilemma because the words “practice” and “site” mean different things to different people. You could create custom cultures for specific customers. For exam- ple, you could create an English (United States, Sirius Minor Publica- tions) custom culture to serve the Sirius Minor Publications customer, and an English (United States, Megadodo Publications) custom culture to serve the Megadodo Publications customer. Both cultures would have a parent of English (United States) or just English, so that the majority of text would be common to all English customers. Sirius Minor Publications would have resources that used their own commercial dialect, and, likewise, Megadodo Publications would have resources that used their own commercial dialect. The benefit to the developers is that the application has a single code base while still catering to the needs of indi- vidual customers.

Using CultureAndRegionInfoBuilder

Creating a custom culture involves two steps:

  • 1.

    Defining the custom culture

  • 2.

    Registering the custom culture

Both steps are achieved using the .NET Framework 2.0 CultureAndRegionIn- foBuilder class. We start with a simple example of creating a replacement culture to see the process through from beginning to end. We return to the subject later to create more complex custom cultures.

In this example, the culture is a replacement for the en-GB English (United Kingdom) culture. The purpose of this culture is to change the default Short- TimePattern to include the AM/PM suffix (just like the en-US ShortTimePat- tern). The ShortTimePattern is a .NET Framework property and is not part of the

Document info
Document views120
Page views120
Page last viewedWed Oct 26 13:57:45 UTC 2016