Friday, July 24, 2009

Using Microsoft Translate API in LocaleManager

Anyway, I needed to do some translation for an application I was working on. To make this task easier, I tried to plug in some codes to do machine translation with Google Translator. It turned out to be that Google doesn't like people to call their page from an application. After I got the translation from English to Chinese done, I continued to try to get Frech, German, Russian, Spanish, Japanese, and Korean, Arabic, etc. Then it stopped working.

I was getting 302 in service capture. Even when I went to browser to translate.google.com, I was redirected to some other page saying that Google suspect that there is some virus attack going on. It seems like Google only supports AJAX API for its translator, meaning that you can use it on webpages to let user to translate the page. But they don't want people to keep on request their page through an application. (That's interesting. I remeber when I was trying different load testing tools, I tried to use the tool to go to Google first to make a sample Load test.) I am not sure for how long Google block my IP. At least after the weekend, everything went back to normal.

Before I saw some news about Microsoft's Machine Translator and always wanted to try it. It turned out to be very simple to use. Here is a link to the Translate method on MSDN. An appID is required and here is the link to apply for an appID. I used the HTTP API in my application. For more details about other translator API, the Translator Hands on Lab is a good place to get information.

The Terms of Services for using the API are not very clear though. It seems like it is okay to use it in an application, however Microsoft reserves the right to start charging an app developer depending on the usage of their service. It is not clear like the Maps API's terms of services: Unlimited use. Use it in anyway you want.

But anyway, localManager now has the capabilities to do translation. It actually works pretty well. Human proof reading and editing is necessary of course with the machine translated text, but most of the translation is usable. At least it saves a lot of time and energy. From the Chinese translation I went through, I have to say that Microsoft Translator's overall quality is better than Google's. Microsoft's Translator can rearrage a phrase when needed pretty well. I was surprised with some translation they did for Chinese.

I want to take another look at the Terms and Services first and then I can push my new version of localeManager with translation capabilities.

2 comments:

  1. Angela, I came across your locale manager and it will fit my needs beautifully.
    I was hoping to make some small modifications to better match the needs of my translators. I can't seem to find the source for the latest iteration of our excellent little program. Specifically, the executable I have has translation capabilities. Both versions of the source I have found on CodeProject and code.google.com are older versions. Any chance I could get the latest version you have. I know this is ancient code but it still works beautifully.

    ReplyDelete