What are the best approaches to delivering similar business functionality via a multi-lingual UI?

by Adrian on September 4, 2009

The .NET framework provides powerful support for internationalisation. To deliver a .NET application to an international customer base do the following:

Determine which aspects of the application differ between territories. If necessary consult someone who has a thorough cultural, linguistic and business understanding of each target territory. This will eliminate the possibility of making potential significant mistakes which would not be apparent to non-native inhabitants.

If business rules differ then any changes should be encapsulated within separate classes. If possible a polymorphic strategy should be implemented by adding a standard interface to each class. This would make it straightforward to configure the application to support different territories.

Other local-specific data such as postal codes, address formats, units of measurement, currency symbols, string sorting and comparison rules, time zones etc can be encapsulated within the CultureInfo class which can then be extended for each different territory. The .NET framework provides the ability to define both cultural and regional differences. For example, en-GB is used to refer to the United Kingdom and en-US to the USA.

Simple UI linguistic differences should be supported by sub-classing standard web controls (e.g. labels) to enable them to dynamically load their text property using the System.Resources.ResourceManager.GetString() method. This method relies on the CurrentCultureInfo class in order to determine what string to return.

In more complex cases, such as where languages have word lengths that are significantly different (i.e. greater) from English a different web page may be required because input controls may have to be repositioned.

Ensure that support or developer focused information, such as logging, debugging and technical exceptions are implemented in the language of the software vendor (i.e. English)

Ensure that end-user information such as business errors and help systems are localised using the System.Resources.ResourceManager.GetString() method.

Determine how to let users indicate their preferred locale. There are a variety of ways to do this with web applications. But it all has to start with that first visit. If the application has a registration or logon page you might collect their preferred culture setting there. If not, you might default to English and let them select a new culture through the UI. Another solution would be to default to the user’s language selection in Internet Explorer. This information is supplied to the web server in the Accept-Language HTTP header field. It can be accessed through the HttpRequest object and then used to set the current thread’s CurrentCulture and CurrentUICulture properties. If the locale is not available then the ‘Satellite resource fallback’ pattern can be used to automatically default to the standard locale (i.e. English) if the requested locale is not available. Subdirectories can be placed beneath \bin (\bin\en, \bin\en-CA, \bin\es, and so on).

Previous post:

Next post: