Hola Legoltaz

, gracias por responder.
Extrañamente ni de tu forma ni la mía me funciona :S
te cuento que estoy jugando con la API traductora de Google (pretendo ir traduciendo por bloques), este es el codigo:
Cita: <!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?key=[key]"></script>
<script type="text/javascript">
google.load("language", "1");
function translate(strIn,strOut) {
var content = document.getElementById('content');
// Grabbing the text to translate
var text = document.getElementById(strIn).innerHTML;
// Translate from Spanish to English, and have the callback of the request
// put the resulting translation in the "translation" div.
// Note: by putting in an empty string for the source language ('es') then the translation
// will auto-detect the source language.
google.language.translate(text, 'es', 'en', function(result) {
var translated = document.getElementById(strOut);
if (result.translation) {
translated.innerHTML = result.translation;
}
});
content.style.display="none";
}
</script>
</head>
<body>
<script>google.setOnLoadCallback(translate('text1' ,'translation1'););</script>
<div id="text1" style="display:none;">Este es el primer texto</div><div id="translation1"></div>
<script>google.setOnLoadCallback(translate('text2' ,'translation2'););</script>
<div id="text2" style="display:none;">Este es el segundo texto </div><div id="translation2"></div>
<div id="content">Loading...</div>
</body>
</html>
(ahora, si te estás preguntando porqué llamo así a la función, es porque cuando esto funcione, los divs los voy a contruir dinámicamente a partir de una base de datos.)
Saludos
PD: Nunca he podido aprender como ponen el código dentro de la cajita de JS, como lo hacen?