Tuesday, 18 June 2013

Google transliteration in ASP.NET

Google transliteration in ASP.NET

Click here for Source code.
Hello Friends,
Today I am going write about  how you can take inputs from user in your local language with the help of Google transliteration in ASP.NET.
But, wait the language in which you are expecting inputs from user that must be supported by Google.
Now let us move to actual demo, in this demo i will be explaining about how one can take inputs from user in local languages (such as  AMHARIC,ARABIC,BENGALI,CHINESE,GREEK,GUJARATI,HINDI,KANNADA,MALAYALAM,MARATHI and so on….) , store that data in to SQL SERVER 2008 and retrieve it back in ASP.NET.
1) Start –> Visual Studio 2010
2) File –> New –>Visual C# —> ASP.NET Web Application
3) Now  we have default page of ASP.NET application ..
now let us make few changes in this file
a) Add the script which load Google Transliteration API…
b) In second script  first we are loading transliteration package with
google.load(“elements”, “1″, {
packages: “transliteration”
Then, in onLoad function
options in which we are specifying about source and destination language source and destination can be any language supported by Google Transliteration,  shortcut key is optional and finally transliterationEnabled: true
Now another variable called control in which we are specifying about TransliterationControlin which we are providing information about Source and destination object..
And in last line we assigning asp.net text box for transliteration in array format. here you can use any input control..
Now we are done with script changes
here I have 2 text boxes in 1 text box I will be saving Emp number and in second Name in Hindi language
Here I typed name in English and after pressing Enter or space button i get result in to Hindi… ( Funny isn’t it ;) )
5) Now let us see code query to save data 
**Imp:  Please note that I have added  ” N ” before txtEmpName, this N will help us in storing data as Unicode in database…
6) DataBase will be like
7)  Now once you have data saved in Unicode  it is easy to retrieve it
In this way you can use any language for your user input supported by Google…..
Thanks to GOOGLE….


  1. sir i want to translate gridview textbox english to marathi through dynamically plz help me thank u in advance

  2. This comment has been removed by the author.

  3. hi

    is that Possible to get data from database and convert to marathi in dataset

    thx in advance