AJAX, HTTP, and SOAP access to Cloud-based Microsoft Translator

Many new and interesting developments on the Microsoft Web platform were unveiled at the MIX09 conference last week, such as Silverlight 3, Eclipse Tools for Silverlight, .NET RIA Services, ASP.NET MVC, Web Platform Installer, IIS Smooth Streaming, Windows Web Applications Gallery, Windows Azure enhancements, Expression Blend SketchFlow, Expression Web SuperPreview, Internet Explorer 8, etc. Here’s an innovative service that was not highlighted during the keynote presentations.

Microsoft Translator

Microsoft Translator, also branded as Live Search Translator, is a free language translation service that can take any text-based content (text strings, HTML pages, XML, etc.) as input, and translate it from one language to another, such as Arabic, Chinese (both simplified and traditional), French, German, Japanese, Spanish, etc. The service has been around for a while, and is very similar to the Google Translate offering.

imageAt MIX09, the Microsoft Research Machine Translation (MSR-MT) team unveiled the web page widget (see the picture on the right), which is a fully customizable widget that anyone can be embedded into any website, and gain the ability to allow international visitors to utilize Microsoft Translator to translate web pages into their languages. I have installed it on this blog as well, and you can find it in the column on the right. Give it a try! :)

To people familiar with the Google Translate service, this may not be anything new (such as hovering on a translated sentence and seeing the original content popup). As Google Translate also provides a widget for people to embed into their websites, and it at this point has a higher number of supported languages. But the user experience in the Microsoft Translator widget is pretty nice. It does not bring the viewer to a new page, but instead, just parses and translates the content in document.body in-line and dynamically. And allows viewers to switch back to the original content by removing the “layer” of translated content.

On longer pages, the running progress of translation is also displayed in a fixed layer added to the top of the page. Closing this “header” layer also flips the view back to the original content. This is a little different from the Google Translate widget’s behavior, where it points the viewer to a new page with an HTML frame at the top. Ultimately they do very similar things, though the newer Microsoft Translator widget seems to have applied a little more user experience design.

SDK Support

Now this is one thing that Google Translate doesn’t seem to support at this moment. Microsoft Translator provides a set of HTTP, AJAX, and SOAP interfaces for anyone to interact with via code. This means any application, whether it’s client-side using JavaScript (which the widget itself uses), Silverlight (C# implementation), WPF, Win32, mobile applications, etc., or server-side (C# using WCF) integration, can now leverage the Microsoft Translator service to translate any text-based content.

The MSR-MT team has provided a live SDK for people to play with, built in Windows Azure, at http://translatorsdk.cloudapp.net/.

A couple of interesting functional features or scenarios with the service API’s:

  • Translating individual elements on a web page (instead of the entire page)
  • Performing in-line translation asynchronously (thus not impacting page rendering time)
  • Performing translation by excluding individual elements, which can be quite useful too if we want to translate the entire page except a few elements
  • Parsing and interpreting the language of the input content

This open and accessible services API has allowed Microsoft to provide a number of clients to the Translator service:

The quality of translation is very comparable to Google Translate. I didn’t do an exhaustive study of the results, but just comparing a few pages translated to Chinese, I found things that were better on both services.

And of course, this is not all. The MSR-MT team is busy working on a number of enhancements and new features. Read their blog at blogs.msdn.com/translation for more details, and new announcements as they become available.