Quote:
Originally Posted by xelawho
something else I just noticed is that, while it's reasonably reliable in Chrome and IE, firefox returns "undefined" in the translated-back-to-original frame. Dunno why, and being that my work made me install this stupid extension for firefox that makes firebug unuseable I can't see why that would be, either.
Maybe someone else can take a look.
|
Yes you were right to flag this up.
The sys is simply not working in FFox.
It is the English text that is being transferred, rather than the French.
Note: you can confirm this by hovering the mouse cursor over the supposed reverse translated text.
The dialogue box should show the French source.
However, it shows English as the source.
Further; FFox console doesn't flag up any errors.
Chrome does seem reliable.
I did have problems, but I believe that was due to the fact that I had not fully stripped out my own code for focus, onclick, and Ctrl+shift.
Also, when I first tried it; it was without the:
Code:
var text=text.replace(/\n/g,"<br>")
It worked fine.
When I introduced the variable, it created problems.
I removed it, and Chrome was stable once again.
This made no difference to FFox.
Conclusion (theory)
FFox is happy with the new automation code.
But, the "if comparators" are reading the fr/en variables differently
OR
the variables are being streamed differently.
OR
'thetext' does NOT equal 'res' the moment new English text arrives.
Therefore the English is sent (rather than the French).
When English is typed, it appears in the Fr2En frame as English.
It is written in, when the previous state of the frame was French.
Ie. Could it be functioning back to front sending the wrong 'different' text.
Well, we are certain that it is sending the wrong text.
At least it's a start.
Code:
function checkIt(){
var thediv=document.getElementById("thetext")
res=thediv.innerText?thediv.innerText:thediv.textcontent;
if(thetext!=res){
parent.frames['theframe2'].googleTranslateElementInit(thediv.innerHTML);
} else{
setTimeout(checkIt,500)
}
}