Google Translation API Integration in .NET

Posted by Jalpesh P. Vadgama on ASP.net Weblogs See other posts from ASP.net Weblogs or by Jalpesh P. Vadgama
Published on Tue, 18 May 2010 06:39:17 GMT Indexed on 2010/05/18 6:41 UTC
Read the original article Hit count: 895

This blog has been quite for some time because i was very busy at professional font but now I have decided to post on this blog too. I am constantly posting my article on my personal blog at http://jalpesh.blogspot.com. But now this blog will also have same blog post so i can reach to more community.

Language localization is one of important thing of site of application nowadays. If you want your site or application more popular then other then it should support more then language. Some time it becomes difficult to translate all the sites into other languages so for i have found a great solution. Now you can use Google Translation API to translate your site or application dynamically. Here are steps you required to follow to integrate Google Translation API into Microsoft.NET Applications.

First you need download class library dlls from the following site.

http://code.google.com/p/google-language-api-for-dotnet/

Go this site and download GoogleTranslateAPI_0.1.zip.

Then once you have done that you need to add reference GoogleTranslateAPI.dll like following.

AddReference,Google,

Now you are ready to use the translation API from Google. Here is the code for that.

string Text = "This is a string to translate";
Console.WriteLine("Before Translation:{0}", Text);
Text=Google.API.Translate.Translator.Translate(Text,Google.API.Translate.Language.English,Google.API.Translate.Language.French);          
Console.WriteLine("Before Translation:{0}", Text);

That’s it it will return the string translated from English to French. But make you are connected to internet :)… Happy Programming

Technorati Tags: ,
Shout it

© ASP.net Weblogs or respective owner

Related posts about ASP.NET

Related posts about globalization