Showing posts with label Google Translate. Show all posts
Showing posts with label Google Translate. Show all posts

Thursday, September 03, 2009

Translation as a Service: Microsoft; Bing Translator vs. Google Translator

I just come across Bing Translator from Microsoft; I have been working on a multilingual web portal, so I have been using Google Translate quite extensively. I have also placed a code snippet in my previous post that can help anyone to translate variable names, web service response and error messages at run time from Google supported languages to English.

Today for the first time I come across Bing Translator and the first impression to this service I awesome, I really liked its auto detect feature, I tried it and amazingly it worked fine, WOW, so as predicted Bing is going to give hard time to Google. Competition always helps companies to grow and at the same time provide better services to the end users.

An early look at the Bing Translator shows that it provide a lot more features as compared to Google Translator.


It has tools for end users, providing lot of good quality services like you can add an MSN blog for translation, that's really cool.


It also provides cool tools for the web master and last but not the least, tools for Developers J to build cool multilingual applications using any of the available options, good things is that it has support for JavaScript through AJAX Interface API. I look forward to lot of cool applications written on top of it.

I believe there is a huge potential in this regard building translation as a service, and I think Microsoft is right on track this time!


Friday, August 28, 2009

Google Translate: Web Services written in languages other than English

A utility function that can be used when dealing with web services written in languages other than English that returns value in foreign language like french, even the variable names are in that language and the error messages returned. With this utility function it's very easy to debug the application. Just add this function in one of the utility class in yur project.

public
string TranslateText(


string input,


string languagePair)

{

string url =

String.Format("http://www.google.com/translate_t?hl=en&ie=UTF8&text={0}&langpair={1}",

input, languagePair);

WebClient webClient = new
WebClient();

webClient.Encoding = System.Text.Encoding.UTF8;

string result = webClient.DownloadString(url);

result = result.Substring(result.IndexOf("id=result_box") + 24);

result = result.Substring(0, result.IndexOf("</div"));

return result;

}

Usage: you can call this function like this

TransalteText(inputString, "ar|en")

It will convert the inputString from arabic to english and return the english text

It will convert the inputString from arabic to english and return the english text