Google Translation API Integration in .NET
- by Jalpesh P. Vadgama
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. 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: GoogleAPI,Translate