Building Multilingual Application
February 21, 2011Posted by on
Multilingual applications are those which which supports the different Language for customers of different counties.
The most important thing to develope the ML Application is Resource file, which contains all the ML Data such as the text which is to be displayed on the form (in different languages).
These resource files can be the file with “resx” extension or may be with “txt” extensions.
Suppose we want to generate one resource file for Hindi Language one for Franch Language and soon.
These files will be named as follows :
Hindi Language : Resource.HI.txt
French Language : Resource.FR.txt
We know that the Satellite Assembely id needed to make Multilingual Application.
So we will use “Resgen.exe” comand to generate Satellite Assembely, that can be done as follows :
These two commands will generate the Satellite Assembely for these resource files with following names :
These generated resource files we will put in a folder named “Resources”.
With this we have completed our first round of work.. 🙂
We will build this application and this will generate two new folders in “Bin” directory with the name “FR” and “HI”.
Along with this we need to place these two files in Resource Folder inside Bin.
Now we have done with the Satellite Assembely generation part, now all we need to do is use these Satellite Assembely in our code by reading content from it.
For this we will create one class and place following code in that to read the Resource content.
This HI resource file contains :
In this file we need to place different Namespaces :
This is the main code which will read the Resource file.
Now we will write the code to call this function on some button…
This above function we can call on any control say on Button Click…
And we are done with the Localisation… 🙂