Browse DevX
Sign up for e-mail newsletters from DevX


Localizing ASP.NET 2.0 Applications

As we compete in the global economy, the challenges in globalizing include understanding the language and culture of the local audience. An application written for the American market may not be useable in the Asian market. Learn to localize your application for the world market.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

he recommended way to create cross-language Web sites is to localize using .NET's support for culture codes. Here are some examples of culture codes:
  • en-US: "en" represents the English language. "en-US" provides a specific culture, that is, the culture representing English used in the US
  • en-GB: This culture code represents the English language used in Great Britain.
  • fr-CA: This culture code represents the French language in Canada.
  • zh-CN: This culture represents the Chinese language used in the People's Republic of China.
The localization process involves tasks such as:

  • Date formatting. People in the United States represent dates in a different format from someone in, say, the United Kingdom. Does "2/7/2004" represent the 2nd of July, 2004, or does it represent February 7th, 2004? The answer depends on where you are located.
  • Changing displayed text from one language to another. For example, the text in your application must change to Chinese if you are targeting the Chinese market.
  • Text direction. Does text read from left to right or from right to left?
As a developer, you need to be concerned with the following:
  • Globalization. When designing your application, you plan for all the necessary resources needed to enable your application to be modified with ease to suit different cultures.
  • Localization. You perform the actual transformation to ensure that the user sees the application using the culture he/she has selected.
The Culture and UICulture attributes automatically map information received in the Accept-language headers to the CurrentCulture and CurrentUICulture properties of the current thread, thus allowing controls on the page which are culture-aware to localize.
In this article, I will discuss the localization feature in ASP.NET 2.0 (based on Beta 1) and how it simplifies the task you need to perform to create international applications.

Localization Basics
Before we see how ASP.NET 2.0 makes localization easy, let's understand some basics in localization. A culture is a way to identify a particular setting pertinent to a location or country. You use a culture code to represent a culture. A neutral culture represents a culture that is associated with a language but is not specific to a particular location. For example, "en" is a neutral culture, because it represents the English language but does not provide a specific instance of where it is used.

A specific culture is a culture that is specific to a region or country. For example, en-GB is a specific culture. Finally, the invariant culture is neither a neutral nor specific culture. It is English, but is not associated with any location. The invariant culture is used to represent data that is not shown to the user. For example, you use the invariant culture to persist date information to a file. This ensures that the date information would not be misrepresented if is it going to be interpreted in another specific culture.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date