Google translate get current language
google-translate, javascript
Solution
Your not gonna believe it:
window.setInterval(function(){
var lang = $(".goog-te-menu-value span:first").text();
alert(lang);
},5000);
I just had to dig to find the container in Firebug and grab the value from the first span element. Hope this helps someone.
Problem
After finding zero of anything to help me online.... I am using the current function for a multi language site: ``` function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'en,es', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element'); } ``` However I have no idea how to get the current language once a user changes it. I'm not sure if this is even possible. Basically I want to update to Spanish images if Spanish is chosen over English. Any help would be appreciated!