I am using google translator
to translate my website into multiple languages. But for some reason I want to get the selected language
to trigger some function
. I have gone through some questions based on this in stack overflow
but those does not help me, for example this and this.
Here is my javascript code which I am using to translate.
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'es,hi,th,vi,zh-CN', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
}
Your suggestion will help me a lot.