With the advent of .Net creating multi-lingualwebsites has become easy. Earlier you needed to create pages for each language. Moreover editing such content was also tedious. Creating multi-lingual applications is the first step towards globalization of an application.
An application can be considered truly global if users of different cultures and languages can access the application. You need to separate the application’s resources which need to be translated from the main code of the application. Then you customize the application to meet the requirements of the different cultures and languages.
.Net provides the CultureInfo class and the namespaces like System.Globalization and the System.Resources.ResourceManager. While building a globalized application you must concentrate on the globalization part in the design phase. This would save you a lot of time and money. The CultureInfo class provided by .Net gives culture specific information. This information can be language, region, calendar and other parameters associated with a culture.
A unique name for each culture is specified based on the RFC 1766 standard. The CultureInfo class provides information required to process strings, casing, dates and numbers associated with a specific culture. The name of a culture is given in lowercase two letters indicating the language followed by uppercase two letters indicating the region or country. This subculture code in uppercase is separated from the lowercase culture code by a hyphen. For example “ja-JP” indicates the language Japanese as spoken in Japan.
Let us consider a webpage which displays a label in different languages based on what the user has selected. To achieve this you should create resource files for different languages. The resource file would have the equivalent of the text that is to be displayed in the label.
For example, if you want to display the word “Username” in French, you willcreate a resource file that would have “Nom d’utilisateur” as an equivalent for “username”. Resource files are just XML files that contain data mapping to different languages. For example, the following data may be in a resource file, Res.fr-CA.resx which indicates the French language spoken in Canada.
<data name="Username">
<value>Nom d'utilisateur</value>
</data>
If you want to assign this word in the label, you need a ResourceManager object to perform this action. The ResourceManager is responsible for getting the right word from the correct resource file. The ResourceManager gets the information from the current thread’s CurrentCulture value. For example, the code required to assign value to a label would belike:
lblUserName.Text = rm.GetString("Username");
where rm is an instance of ResourceManager.
To get the correct information from the correct resource file, you need to write something like,
CultureInfo ci = new CultureInfo("fr-CA");ci;
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
System.Threading.Thread.CurrentThread.CurrentUICulture =
The last statement is where the ResourceManager locates the correct resource file for that particular culture.
Setting the culture info has to be done dynamically when the user clicks on a link for a particular language version of the site. This is very easy. You can simply pass a query string to the .aspx page and retrieve the value of the querystring in the Application_BeginRequest of the Global.asax file and then set the CultureInfo instance. The code given below retrieves the querystring “language” and checks the value of the querystring.
protected void Application_BeginRequest(Object sender, EventArgs e) {
string slang = Request.QueryString["language"];
string cinfo = "en-CA";
if(lang != null){
switch (slang.ToLower()){
case "frc":
cinfo = "fr-CA";
break;
default:
cinfo = "en-CA";
break;
}
}
CultureInfo c = new CultureInfo(cinfo);
If the value of the querystring is “frc”, then the CultureInfo is set to “fr-CA”then the current thread’s CurrentUICulture is set to this culture information. This would enable the ResourceManager to select the appropriate resource file and retrieve data that corresponds to that particular culture.
By using these concepts you can create applications that are truly global. These applications will have the resource files in the assembly and you have to recompile the application when you add some other resource files. It is possible to compile the resource file into a separate assembly and use that resource file for all the applications.

"When we're looking for outsourcing software development, we look for a responsive, committed development partner, not just a technical resource. LTechIndia has been a valuable partner for many years and we look forward to several more high-quality projects with them."

