Friday, March 21st, 2008
Google AJAX Translation API
The game above uses the new Google AJAX Translation API that allows you to do two things via a simple JavaScript API.
Translation
If you want to take a word in one language, and translate it to another, you simply call something like this:
-
-
google.language.translate('Gato', 'es', 'en', function(result) {
-
alert(result.translation);
-
});
-
Here are the languages we support.
What if you need to programatically grok which language a string is written in? You can use the detection algorythm:
-
-
google.language.detect('Questa linea di rilevare che questa è la lingua.',
-
function(result) {
-
alert(result.language);
-
});
-
The detector doesn't just tell you the result, it also lets you know how reliable and confident it is.













This is awesome!
Naaaaais! Now for the optional translational-correction api so that we can all improve their services. EN => DUT translation *SUCKS* big time!
I’m interested in trying out the performance for entire pages, such that I can let a user select a language on screen, and the content is automatically translated.
For English-Russian translations, the demo above provides strange results: words are translated mostly correctly but some of them appear in the wrong case (genitive instead of nominative, which are spelled differently in Russian), and some have their first letter capitalized for no obvious reason.
I played that 138 times… it’s addicting!
@Cory, there is a script here to make arbitrary html elements translatable.
I wish there is support for Urdu as well.
By the way, is there anyway to detect whether the language is RTL or not?
@minimalmedia — very nicely done, except for one thing: you’re not caching the source text. If I click, say, “es” to translate a paragraph to Spanish, then click “en” to go back to English, instead of restoring the original English text, it translates to Spanish translation back into English, introducing translation artifacts. Eg. “Put to work on his own blog, or better yet, somehow better” instead of the original, “Put it to work on your own blog, or better yet, improve it somehow.”
Err, “translates the”, not “translates to”. My own writing sounds like it was run through Google translation too many times…
Wonderful! I’ve updated my previously-server-side app to fully JS. Tryanslator is probably the least fuss, user-friendly translation service :-)
ÐžÑ‚Ð»Ð¸Ñ‡Ð½Ð°Ñ Ð½Ð¾Ð²Ð¾Ñть. Ñ ÑƒÐ¶Ðµ первый обзор Ð´Ð»Ñ Ñ€ÑƒÐ½ÐµÑ‚Ð° напиÑал, Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ð°ÑŽÑ‰Ð¸Ð¼ примером. Оригинал здеÑÑŒ: http://abrdev.com/?p=286
Of couse, the Google API have limitation - only up to 500 char are translated at onse, but no limit to translate request’s from one site/page
Nice, now if only the google toolbar spellchecker would be available as a good API…
There seems to be indeed a limit on the text chunks that can be translated. We’ve implemented the new API for MapSkip and we simply break the text into paragraphs and run those through the API individually.
From our experiments, the limit seems to be roughly 1400 characters.
Languages with different word order like Japanese will never be accurate using this method. If you want to learn almost any language in the world so you can understand them properly, my site helps you to do it the easy way.
http://www.google.co.jp/search?q=cutout+japanese+english+cutouttranslations&btnG=%E6%A4%9C%E7%B4%A2&hl=ja&lr=lang_ja&client=firefox-a&rls=org.mozilla%3Aja%3Aofficial&hs=k5L
Nice one thanks for posting this. Such a simple implimentation for language translation. All we need now is for the mechanical translation to improve but i’m sure google is working on that.