Este script lo que hace es cambiar o mas bn dicho traducir los tags que tengan la propiedad name="setlng" ahorita esta de en a es osea ingles a español
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google AJAX Search API Sample</title> <script src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("language", "1"); function translateComplete(results) { var translationDiv = document.getElementsByName("setlng"); if (!results.error) { for (i=0; i < results.responseData.length - 1; i++) { y = i + 1; var result = results.responseData[y]; ///aqui/// translationDiv[i].innerHTML = result.responseData.translatedText; } } } function initializer() { var callbackFunction = 'translateComplete'; var newScript = document.createElement('script'); newScript.type = 'text/javascript'; var source = 'http://ajax.googleapis.com/ajax/services/language/translate' + '?v=1.0&q='; var totext = document.getElementsByName("setlng"); for (x=0;x<totext.length;x++){ var text = totext[x].innerHTML; source = source + '&q=' + text; } var newBatchParam = '&langpair=en%7Ces'; source = source + newBatchParam; source = source + '&callback=' + callbackFunction; newScript.src = source; document.getElementsByTagName('head')[0].appendChild(newScript); } google.setOnLoadCallback(initializer); </script> </head> <body style="font-family: Arial;border: 0 none;"> <div name="setlng">loding...</div> <div name="setlng">loding 2...</div> <div name="setlng">loading 3...</div> <div name="setlng">loading 4...</div> <div name="setlng">loading 5...</div> <table width="98%" name="setlng"> <tr><td align="center"><h2><strong>Producto</strong></h2></td></tr> <tr><TD> <center> <div class="nav-menu"> <ul> <li><a href="http://redsombrero.co.nz/index.php?mod=eCommerce&ext=productos&id=1" ><<< Atrás</a></li> <li><a href="http://redsombrero.co.nz/index.php?mod=eCommerce">Índice</a></li> <li><a href="http://redsombrero.co.nz/index.php?mod=eCommerce&ext=shop">Ver carrito</a></li> </ul> </div> </center> </TD></tr> </table> </body> </html>