ASP.NET Application Localization and Internationalization

Last Updated June 9, 2013

ASP.NET is one of the most common web application development platforms. As with any other .NET framework application, ASP.NET provides great support for localization and globalization straight out of the box. Following best practices from the beginning of development will result in a properly internationalized application, making ASP.NET application localization an enjoyable process. In order to save money, reduce localization/internationalization defects and shorten the time to market, it’s important to consider localization as part of the development process.

ASP.NET Application Localization: What Needs to be Localized/Translated?

In a typical ASP.NET application, the following four items may differ depending on the user’s language and regional preferences:

Text Resources

All text resources should be externalized to resx files in order to make translation and maintenance easier. Also known as “resources file”, a resx file consists of XML entries which specify objects and strings. Visual Studio does provide an automated way to externalize the strings after the page has been created but this function is limited. It only works on the server tags on aspx pages. Visual Studio cannot externalize the text in CS/VB code or process regular html tags.

The best approach is to externalize the tags as the pages are being developed. More information on the use of resx files for ASP.NET localization can be found on MSDN.

Database Content

The database schema and relations will have to be carefully designed to externalize translatable text to a table(s) which maps to languages and parent tables. Although adding additional columns to existing tables for each language may seem easier; maintenance of this solution is extremely difficult and not recommended.

Images and Graphics

If possible, try avoiding images and graphics with embedded text. Using background images and retrieving the text from a resource file will make the localization effort much easier. If that is not possible, point the source of the image to the resx file which will let you easily change it depending on the language. This applies to other external assets such as pdf and doc files as well.

Regional Options

As in any other programming language and platform, avoid manually formatting and hard coding date/time and number formats. .NET offers a CultureInfo class which provides access to culture-specific instances of objects such as: DateTimeFormatInfo and NumberFormatInfo. Using these objects, culture-specific operations can be performed easily such as formatting dates and numbers, casing and comparing strings.

Related Posts

Summa Linguae uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy.

Learn More