We create the best experience for our users by communicating with them in a way that they understand. .NET provides robust localization and globalization features that allow us to create and deploy applications that adapt for different languages and cultures. We'll take a look at the basics and ready our applications to take on the world.
Jeremy Clark is an application developer, technical speaker, and Microsoft MVP with over 13 years of experience in all aspects of the development lifecycle. After hours, he puts together demos and technical articles for JeremyBytes.com, a website focusing on .NET technologies.
Other .NET Application Types When we localized our WPF application, we saw how resources, satellite assemblies, and cultures all work together. Now we'll take a look at some other. NET application types. The basic principles are the same, but the details differ depending on our environment. We'll continue looking at the built-in. NET support for localization, and we'll adapt it for various application environments. Along the way, we'll reinforce the things that we've seen so far.. NET offers many different application environments, including desktop apps, web apps, and mobile apps. And each of these deals with localization just a little bit differently. We've already seen how to localize a WPF application, now we'll look at examples in Windows Forms, Asp. NET Web Forms, ASP. NET MVC, and Windows Store Apps. As with WPF, there are several different approaches we could take in each environment. Since we're still learning the basics, we'll stick with the same general format as our WPF application, creating localizable Resource files. All of our examples are already localized. This lets us focus on just the things in each environment that make it unique.
Considerations Now that we've looked at the basics of localization, and seen it in action, we need to spend a little time on considerations, the things we need to think about when we're localizing our applications. One of our goals is to get ready for the real world, and that's what we'll focus on here. There are many things we need to think about when localizing our applications. Some of these are simple, like coming up with a naming scheme for our resources. But others can cause problems if we're not careful. What happens if we try to use country flags to represent language? How do we make sure that our translations are good? Should we localize our exception messages? We'll look at all of these things, plus a tool that can help us make sure we're not missing anything when we're getting our applications ready for localization.
Globalization Now it's time to move beyond language to think about globalization. And globalization is all about getting ready for the real world. And this also happens to be the last stop on our journey. So, let's get to it. As a reminder from our definitions, globalization is the process of engineering an application so that it does not have cultural preconceptions. This means that our application should be able to handle and display different DateTime, number, and currency formats, as well as differences in comparing and sorting strings. There may even be differences in calendars, such as which day is the first day of the week. Here are the examples that we saw before. Depending on the culture, we will want to display dates, numbers, and currency differently, and we will need to keep this in mind when parsing input as well. These are just a few of the things that we'll consider when we think about globalizing our applications.