Understanding Cultures

Before you can start localizing applications, you need to understand the concept of a culture. A culture, in .NET terms, is a more precise identifier than a location or a language. A culture identifies all the things that might need to be localized in an application, which requires you to know more than just the language. For example, just knowing that an application uses English as its user interface language doesn't give you enough information to completely localize it: Should you format dates and currency amounts in that application in a way appropriate to the United States, the United Kingdom, Canada, Australia, or New Zealand (among other possibilities)? Similarly, just knowing the location isn't enough: If an application will be used in Switzerland, there are four possibilities for the user interface language. Each combination of location and language identifies a culture.

662 Part I DEVELOPING WEB APPLICATIONS

About Culture Codes

The .NET Framework follows the IETF Standard RFC 1766 to identify cultures. Cultures are identified by abbreviations called culture codes. A full culture code consists of a neutral culture code (written in lowercase), followed by one or more subculture codes (written in mixed case or uppercase). Here are a few culture codes as examples:

♦ de identifies the German clture. This is a neutral culture—a culture that does not specify a subculture code. Neutral cultures generally do not provide sufficient information to localize an application.

♦ en-GB identifies the English (United Kingdom) culture. This is a specific culture—a culture that provides enough information to localize an application (in this case, for English speakers in Great Britain).

♦ az-AZ-Cyrl is an example of a specific culture with two subculture codes. This particular culture refers to the Azeri language in Azerbaijan, written with Cyrillic characters.

The CultureInfo Class

The .NET Framework represents cultures with the System.Globalization.CultureInfo class. This class lets you retrieve a wide variety of information about any particular culture.

Was this article helpful?

0 0

Post a comment