by using google api ..
i tried to translate language...
it works but not for the full page only for selected div tag...
plese tell me how to modify or
how i get the full page translated text....body of html or php page
<?
$lang=$_GET['lang'];
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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;
// var text = content.document.body;
google.language.detect(text, function(result) {
if (!result.error && result.language) {
google.language.translate(text, result.language, "<?=$lang?>",
function(result) {
//var translated = document.getElementById("translation");
var translated = document.getElementById("text");
if (result.translation) {
translated.innerHTML = result.translation;
//text.innerHTML = '';
}
});
}
});
}
google.setOnLoadCallback(initialize);
</script>
</head>
<body>
<a href="xyz.php?lang=hi" title="Hindi" rel="nofollow"><img src="images/hi.png" alt="Hindi" /></a>
<a href="xyz.php?lang=ar" title="Arabic" rel="nofollow"><img src="images/ar.png" alt="Arabic" /></a>
<a href="xyz.php?lang=zh-CN" title="Chinese" rel="nofollow"><img src="images/zh.png" alt="Chinese" /></a>
<a href="xyz.php?lang=nl" title="Dutch" rel="nofollow"><img src="images/nl.png" alt="Dutch" /></a>
<a href="xyz.php?lang=en" title="English" rel="nofollow"><img src="images/en.png" alt="English" /></a>
<a href="xyz.php?lang=fi" title="Finnish" rel="nofollow"><img src="images/fi.png" alt="Finnish" /></a>
<a href="xyz.php?lang=de" title="German" rel="nofollow"><img src="images/de.png" alt="German" /></a>
<a href="xyz.php?lang=it" title="Italian" rel="nofollow"><img src="images/it.png" alt="Italian" /></a>
<a href="xyz.php?lang=ko" title="Korean" rel="nofollow"><img src="images/ko.png" alt="Korean" /></a>
<a href="xyz.php?lang=ru" title="Russian" rel="nofollow"><img src="images/ru.png" alt="Russian" /></a>
<a href="xyz.php?lang=es" title="Spanish" rel="nofollow"><img src="images/es.png" alt="Spanish" /></a>
<a href="xyz.php?lang=fr" title="French" rel="nofollow"><img src="images/fr.png" alt="French" /></a>
<div id="text">Formally, DFS is an uninformed search that progresses by expanding the first child node of the search tree that appears and thus going deeper and deeper until a goal node is found, or until it hits a node that has no children. Then the search backtracks, returning to the most recent node it hadn't finished exploring. In a non-recursive implementation, all freshly expanded nodes are added to a LIFO stack for exploration..
</div>
<span class="bluenormal"> </span><br/><br/>
<span class="bluenormal"> Formally, DFS is an uninformed search that progresses by expanding the first child node of the search tree that appears and thus going deeper and deeper until a goal node is found, or until it hits a node that has no children. Then the search backtracks, returning to the most recent node it hadn't finished exploring. In a non-recursive implementation, all freshly expanded nodes are added to a LIFO stack for exploration. </span><br/><br/>
<span class="bluenormal"> Formally, DFS is an uninformed search that progresses by expanding the first child node of the search tree that appears and thus going deeper and deeper until a goal node is found, or until it hits a node that has no children. Then the search backtracks, returning to the most recent node it hadn't finished exploring. In a non-recursive implementation, all freshly expanded nodes are added to a LIFO stack for exploration. </span><br/><br/>
<span class="bluenormal"> Formally, DFS is an uninformed search that progresses by expanding the first child node of the search tree that appears and thus going deeper and deeper until a goal node is found, or until it hits a node that has no children. Then the search backtracks, returning to the most recent node it hadn't finished exploring. In a non-recursive implementation, all freshly expanded nodes are added to a LIFO stack for exploration. </span><br/><br/>
<div id="translation"></div>
</body>
</html>