Google AJAX Translation API
Date : 2008 03 21 Category : Tech & DevelopmentThe 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:
PLAIN TEXT JAVASCRIPT: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:
PLAIN TEXT JAVASCRIPT: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.