I have implemented the the Free google translate plugin into my website but after I inject text into the page using JS it doesn't translate the newly injected text.
I can't delay the translation process after getting the text because user actions cause the text injection.
I have seen this question: https://stackoverflow.com/questions/36100201/how-i-can-call-google-translate-using-function-on-submit
But it has no answer and not the exact question that I want to ask.
- Is there any method to send callback function to google's translation JS function?
- What are the limits of using Google's website translation plugin ?
Google Translate Web Plugin translates automatically all the visible text on the page as you scroll the page.
Implement callback mechanism for changing language in Google Translate web plugin:
document.getElementById("google_translate_element").addEventListener("change", onLangChange, false);
And finally I have added onLangChange Function to be fired up as the user changes/selects language:
I hope this will help someone here !!!