Google AJAX Language API






Google AJAX Language API


Automatic Translator Example:

Gadget URL: http://hosting.gmodules.com/ig/gadgets/file/106323307000219006410/google-language-ajax-api.xml

The following German Translation has been created automatically.
 

Google Language AJAX API









AJAX Language API Gadget Code:

<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="Google Language AJAX API" />
<Content type="html"><![CDATA[
<script type="text/javascript" src="http://www.google.com/jsapi"> </script>
<script type="text/javascript">

google.load("language", "1"); 
function initialize() {
var text = document.getElementById("text").innerHTML; google.language.detect(text, 
function(result) {
if (!result.error && result.language) { google.language.translate(text, result.language, "de",
function(result) { 
var translated = document.getElementById("translation"); 
if (result.translation) { translated.innerHTML = result.translation; } }); } }); }
google.setOnLoadCallback(initialize); </script>

<div id="text">This is a automatic translation example for Google AJAX Language API.</div>
<br><b>German:</b><div id="translation" style="color:#999999"></div>]]></Content>
</Module>

You can develop more advanced language support through Google AJAX language API.