Into the Google Indic Transliteration

Hey,

I had seen it first in blogspot, but it was today that a friend pointed me to the Google Labs home page of the Indic transliteration application.
Some time ago, I was working on a greasemonkey script that added this capability to any text boxes on the browser. I was using QuillPad at the back to fetch the words in Indic languages. The script however broke after the guys at QuillPad decided to change the API to disallow spaces in the queries. I had also written a plugin for the YUI Rich Text Editor that had the same functionality. I had used QuillPad again; I could not really find a competing service.
Today, I was peeking a little into the service that Google was providing, and found that it did stuff similar to quillpad, just that it was a little faster, and accepted whole sentences. The Indic Transliteration of Google is JavaScript based, and makes AJAX calls to an endpoint that represents something like

http://www.google.com/transliterate/indic?tlqt=1&langpair=en|hi&text=q%2Ca&tl_app=3

The parameters are
  • tlqt=1 -- The value always has to be 1. Seems to be some kind of page identifier.
  • langpair=en|hi -- Looks limilar to the google translation tools, representing transliteration from English to Hindi
  • text='"' -- Words are separated by %2C (which happens to be the comma character). Apparently, the text is expected in a comma separated format.
  • tl_app=3 -- Only value 1,2,3,4 seem to work. Any other value does not an AJAX style response.
The response obtained is a JavaScript code while(1);[]. The array at the end contains the response object that is self explanatory. The AJAX call is made at every word ending, marked by spaces, commas, full stops, etc. The response handler to the AJAX call not only uses a hidden DIV to populate the indic characters, it also replaces stuff in the TEXTAREA.

I am planning to get the GreaseMonkey Script functional again using this service. I am also planning to replace the dependency of QuillPad for the YUI Rich Text Editor. However, I am not really sure why the google guys have not come up with a JavaScript widget for this !! (I am not aware if this is available as a part of GWT though. )