Localizing web applications
with ASP.NET 2.0

Milan Negovan

AspNetResources.com

Definitions

Let's define internationalization and localization.

Inter·nation·al·i·zation (i18n)

Adaptation of products for potential use virtually everywhere.

Efforts include:

(Source: Wikipedia)

Local·i·zation (L10n)

The process of customizing an application for a given culture. Localization consists primarily of translating the user interface.

(Source: MSDN)

Meet CultureInfo Class

Provides information about a specific culture, such as the names of the culture, the writing system, the calendar used, and how to format dates and sort strings.

You can run from CultureInfo, but you can't hide.

i18n Demo

Show off the magic of CultureInfo.

Neutral and Specific Cultures

Resource Files

XML files that contain the strings that you want to translate into different languages.

You create a separate resource file for each language (e.g, English and French) or for a language and culture (e.g. English [U.K.], English [U.S.]).

Example:

NOTE: basic name is arbitrary, but should be the same!

Global and Local Resource Files

You can read global resources from any page of your web app.

Local resources apply to only one web page. You create one local resource file per page.

Global or Local Resources (I)?

Global (pro):

Global (con):

Global or Local Resources (II)?

Local (pro):

Local (con)

Placement of Resource Files

Culture and UICulture Page Properties

Setting Culture and UICulture Declaratively

or

Setting Culture and UICulture Programmatically

Override InitializeCulture Page method and set Thread.CurrentThread properties accordingly.

L10n Demo

String Operations

String operations can be culture-sensitive or culture-insensitive.

Use CompareInfo class methods to search, compare and sort.

Culture-Sensitive String Operations

Use to display results to the end-user.

Example: elements of user interface, such as lists, pickers, etc.

Culture-Insensitive String Operations

Used to process text internally.

Example:

Consider ordinal operations (next slide).

Ordinal String Operations

Ordinal search is fast and culture-insensitive. One character is equivalent to another only if the Unicode values are the same.

Tips

How to Choose Translation Services

Make sure they...

How to Choose Translation Services (cont'd)

Make sure they...

Resources

ありがとう

(Thank you!)