Globalization and Localization Facts
If your application will be used in multiple countries or languages, you should consider the following aspects when creating the application:
- Globalization is the formatting of data based on a locale or region. It only deals with formatting the output of data, it does not change the value of the data. For example, globalization will not convert U.S. dollars to Japanese yen, but globalization will format the output as U.S. dollars or Japanese yen.
- Localization is the process of adapting an application to a region and includes changing the user interface (such as moving buttons) and providing translated or otherwise different versions of the application. Different versions share the same logic, but have different interfaces.
With both globalization and localization, various elements within the user interface are modified based on the current culture. The culture definition accommodates both language and regional (often country) differences. Culture information is set and modified using the following:
| Construct | Description |
| CultureInfo Class | The System.Globalization.CultureInfo class is used to hold information about different cultures such as:
The CultureInfo class requires that a culture code be passed to its constructor on creation.
|
| Thread.CurrentCulture Property | CurrentCulture is a property of a thread that identifies the cultural settings used for globalization by the thread. The CurrentCulture property returns a CultureInfo object that includes the culture information.You can get this property as shown in the following example:
CultureInfo culture = System.Threading.Thread.CurrentThread.CurrentCulture; The CurrentCulture Property also allows setting the CurrentCulture programmatically. For example: CultureInfo culture = new CultureInfo("en-us");
System.Threading.CurrentThread.CurrentCulture = culture;
The default setting is the user’s Locale set through the Regional Options applet in the Control Panel. |
| Thread.CurrentUICulture Property | CurrentUICulture is a property of a thread that identifies the cultural settings used for localization. You can get and set this property in the same way you get and set the CurrentCulture property.The default value for the CurrentUICulture is the operating system’s UI Language. For multi-language versions, the user UI Language settings are used. |
The following table describes how to customize your application for a specific culture.
| Action | Description |
| Globalization | As you globalize an application, consider cases in your code where data is displayed in given format (such as currency, dates, and decimal numbers). It’s common in a non-globalized application to hard-code the display and formatting of these values. The following example forces the display of the value 5000:
txtNonGlobalized.Text = "$5,000"; To globalize this data, use the ToString method passing the formatting character. The following example displays the value 5000 as currency (the system will format the display based on the current culture). txtGlobalized.Text = (5000).ToString("C");
|
| Localization | Localization involves creating alternate user interface layouts (and text) for different cultures.
The following steps outline how to localize a form.
When the application runs, the appropriate resources will be loaded for the CurrentUICulture. |
Digg it | Save to del.icio.us | Netscape | Reddit | Stumble It!
- - - - - S P O N S O R I N G A D V E R T I S M E N T - - - - -