diff --git a/app/views/layouts/decidim/_head_extra.html.erb b/app/views/layouts/decidim/_head_extra.html.erb index 21749e6..0e63e07 100644 --- a/app/views/layouts/decidim/_head_extra.html.erb +++ b/app/views/layouts/decidim/_head_extra.html.erb @@ -34,20 +34,11 @@ function googleTranslateElementInit() { new google.translate.TranslateElement( - { - pageLanguage: pageLanguage - }, - 'google_translate_element' + { + pageLanguage: autoTargetLanguage + }, + 'google_translate_element' ); - - if (autoTargetLanguage != '' && autoTargetLanguage != pageLanguage ) { - waitForElm('#google_translate_element select option[value="' + autoTargetLanguage + '"]').then((gOption) => { - var gSelect = gOption.parentNode; - gSelect.selectedIndex= gOption.index; - gSelect.dispatchEvent(new Event('change')); - }); - } - }