I am using Google translate on my website with:
let lang = new google.translate.TranslateElement({pageLanguage: 'pt', autoDisplay: false}, 'google_translate_element');
Now I want to get the current language so I do console.log(lang) which gives me:
In "P" I find the language but I am not able to access "P"
console.log(google.translate.TranslateElement('google_translate_element').P)
console.log(google.translate.TranslateElement('google_translate_element')['P'])
all just return undefined.
Any idea how to get that "en"?