This is a mirror of official site: http://jasper-net.blogspot.com/

Localizing Silverlight applications

| Monday, January 31, 2011
Introduction to Globalization and Localization
A decade or two ago, it was cool to use terms like "global village", "information superhighway" and so forth. Now they're clichés. A few years ago, if a small scale enterprise had clients from across the globe, it was considered to be a step ahead of others. Today it's commonplace to have clients and branch offices scattered across the globe. As a developer or programmer, what does this mean for you? It means that you need to be aware of concepts like globalization and localization as well as how to implement them. It means that you need to be prepared to deliver globally-ready applications, no matter what technology you use. The fact that an enterprise or line-of-business application is globally-ready is not a luxury anymore, it's an essential requirement.

But what is globalization? Let's explore.

Globalization
According to the MSDN library, "Globalization is the process of designing and developing an application that supports localized user interfaces and regional data for users in multiple cultures." If your user interface displays currency information, for example, and you display the currency in a format suitable to the current culture then that's globalization. Not just the currency symbols but the decimal places, the thousands separator all differ from culture to culture. This is just an example though. Globalization can involve lot more than just changing currency formats.

Localization
So then what's localization? Again, we turn to the MSDN library which defines Localization as a process "where you customize the application for specific cultures or regions. If the globalization and localizability steps have been performed correctly, localization should consist primarily of translating the user interface."

Localization in .NET (Windows Forms)
So let's look at this from the angle of a .NET application developer. Implementing globalization and localization was a reasonably straightforward task in Windows Forms. You created a number of resource files, each of which contained data specific to a particular culture. Within the application, you set the current culture to a desired culture using the CultureInfo class and retrieved the resources from the resource files. Accordingly, the UI elements would be rendered according to the local culture. The number of resource files depended on the amount of cultures the application would use. That was all there was to a simple implementation of localization.

Localization in Silverlight
But localization in Silverlight is not as straightforward, though it isn't complicated either.

The following steps describe with the help of an example how to implement localization in Silverlight. The example is based on Silverlight 4 and uses Visual Studio 2010.

Create a Silverlight application named LocSilverlight as shown in Figure 1.

Read more: dot Net Slackers

Posted via email from Jasper-net

0 comments: