Home | HTML | Asp.Net | HTML Probe | .Net Probe
  Contact Us |Sitemap

Globalization in Asp.Net

  Skip Navigation LinksHome>Asp Home>Globalization

Implementing internationalization on a web application is very beneficial for established the business in the global market. It means that a web application will be available for the international users in various languages.

Internationalization is a process that enables people from different countries, culture or regions to have information on the website in their native language. It is the combination of Globalization and Localization.

Globalization: Globalization is the process of designing and developing a web application that support various cultures.

Localization: Localization is a process of customizing the globalized application for a specific culture (regions & languages).

Culture: Culture is used to describe the language and region for a country. It is also called as Locale.

Neutral culture: Neutral culture is a culture that only specifies a language, not any region. (Example: "En")

Specific culture: Specific culture is a culture that specifies both language and region. (Example: "en-CA")

Some important cultures code is given below:

Culture CodeDescription
EnIt describes English language.
DeIt describes German language.
de-DEIt describes German language; Germany region.
en-USIt describes English language; United State region.
en-GB It describes English language; United Kingdom region (Great Britain).
fr-FRIt describes French language; France region.
zh-CNIt describes Chinese language; China region.
en-AUIt describes English language; Australia region.
ru-RUIt describes Russian language; Russia region.
en-CAIt describe English language; Canada region.

An international web application contains Data block and Code block.

Data block : Data block of a web application contains user interface resources like text on label control that are to be translated into various languages.
In short we can say that a data block contains a bundle of resource files. These resource files provide the culture information in the set of key pairs. These resource files are XML-based files ending with .resx extension.

Code block: Code block is an executable part of a web application. It is used to execute the resource file.

Note : System.Globalization namespace is used to implement globalization in an application.


CultureInfo class: The CultutrInfo class gives the information (culture name, calendar used, formatting styles etc) about a specific culture.

Some important properties of CultutrInfo Class are given below:

CurrentCultureIt represent the culture for the current thread.
IsNeutralCultureGets a value indicating whether the current culture info class represent a neutral culture.
NumberFormatIt defines the format of displaying numbers, currency etc.
NameReturns the culture name in LanguageCode1>-CountryCode1> format.
CurrentUICultureIt represent the current culture used by the resource manager to look for culture-specific resource at run time.

Culture Declarations technique

Server-Side declarations:
  1. If you want to establish the Culture and UICulture properties for all pages on a website, you should use web.config file as shown in the given code snippet:

        <globalization culture="de-DE" uiCulture="de-DE" />

  2. If you want to establish the Culture and UICulture properties for an individual page, you should use the @Page directive of that page as shown in the given code snippet:

    <%@Page Language="C#" AutoEventWireup="true" Culture= "de-DE"UICulture="de-DE"  %>

    For example: If you simply drag and drop a calendar on that page, the calendar will display in the German language as shown below.
Client-Side declaration

If you want to establish the Culture and UICulture properties according to the user’s browser settings, you need to set the Culture and UICulture values to auto as shown in the given code snippet:

<%@Page Language="C#" AutoEventWireup="true" Culture= "auto"UICulture="auto"  %>

In this example, the web page will automatically deduct into browser's language.

Here is the method to change browser's culture.

RegionInfo Class: The RegionInfo class provides the information about the region.

Some important properties of RegionInfo Class are given below:

CurrencySymbolIt is used to get the currency symbol for the country.
IsMetricIt is used to indicate whether the country/region uses the metric system for measurement.
CurrentRegionIt gets a object that represent the region used by the current thread.
DMCA.com Protection Status
Design & Maintain By solvingera group| solvingera.com © 2013-2014 | all right reserved |Privacy Policy | Back to top