Hi,
I want to use jquery Google translator functionality to translate web page content in specified language. It is working file in Firefox browser, but it not working in IE/Safari/Chrome browser.
Please anyone help to me.
Thanks in Advance
Anil Patel
I have use following js references and function code :
<script type="text/javascript" language="javascript" id="jquery"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="http://jquery-translate.googlecode.com/
files/jquery.translate-1.3.7.min.js"></script>
<script type="text/javascript" src="http://jquery-translate.googlecode.com/
files/jquery.translate-1.4.7-debug-all.js">
function translateTo(fromLang,ToLang){
var busyTr,busyBackGrnd;
var AsyncTranslation=false;
//jQuery.noConflict();
if($.browser.msie && $.browser.version=="7.0")
AsyncTranslation=true;
else
AsyncTranslation=jQuery('body').html().length>180000;
$('body').translate( fromLang,ToLang , { /*translate from english to the selected language*/
not: '.NoTranslate',
fromOriginal:true, /*always translate from english (even after the page has been translated)*/
stripWhitespace: true,
trim:true,
replace:true,
async: AsyncTranslation,
start:function(){
busyTr=AddBusyDiv();
centerXY(busyTr,100,25);
busyTr.style.display="block";
busyBackGrnd = document.createElement("div");
busyBackGrnd.className = "dv-background";
document.body.appendChild(busyBackGrnd);
busyBackGrnd.onclick=function(){busyTr.style.display="none";
busyBackGrnd.style.display="none";};
var m = document,
k = Math.max(Math.max(m.body.scrollWidth, m.documentElement.scrollWidth),
Math.max(m.body.offsetWidth, m.documentElement.offsetWidth),
Math.max(m.body.clientWidth, m.documentElement.clientWidth)),
jc = Math.max(Math.max(m.body.scrollHeight, m.documentElement.scrollHeight),
Math.max(m.body.offsetHeight, m.documentElement.offsetHeight),
Math.max(m.body.clientHeight, m.documentElement.clientHeight));
busyBackGrnd.style.width = k + "px";
busyBackGrnd.style.height = jc + "px";
},
complete:function(){
createCookie("TransLang",ToLang,30);
if(busyTr!=null)
{
remove(busyTr);
}
if(busyBackGrnd!=null)
{
remove(busyBackGrnd);
}
},
error:function(){alert('error');}
});
}