- Code: Select all
<a id="tr_textefr" href="http://translate.google.fr/#fr/en/" target="_blank">
Traduire avec Google</a>
And my french textarea has a javascript function called onkeyup :
- Code: Select all
function translate(what){
var button = "tr_" + what;
var textarea = document.getElementById(what);
var google = "http://translate.google.fr/#fr/en/" + textarea.value;
document.getElementById(button).setAttribute('href', google);
}
For exemple, if I write "Voulez-vous coucher avec moi ce soir ?", it will change the href attribute for "http://translate.google.fr/#fr/en/Voulez-vous coucher avec moi ce soir ?". The link will redirect at the translated version of my text (by google translate).
This code works fine by the way. The thing is that I could have sometimes bbcode inside my text: "Voulez-vous coucher avec moi ce soir ?".
So, is there a way with google translate to disable translating of some words or sentences ? For exemple, I don't wanna translate the words between two @ : "Voulez-vous @@[email protected]@ avec moi ce soir ?"