• Resolved goferit

    (@goferit)


    Hi,

    First off, let me say how stunned I am how automatic and awesome your plugin is, and how well it works right out of the box. Truly amazing.

    The only issue I’m having, and it’s minor, is with our Google Translate scripts. The widget will not load on an initial page visit, but it loads fine on subsequent visits. I have tried putting “element.js” (the only thing I could find in the two scripts that matched your suggested formatting) in the exclusion list, but no change occurred.

    Google’s code:

    JS (placed in Genesis custom footer Theme settings)

    <script type="text/javascript">
    function googleTranslateElementInit() {
    new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.FloatPosition.TOP_LEFT, gaTrack: true, gaId: 'UA-43189356-1'}, 'google_translate_element');
    }
    </script>
    <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit">
    </script>

    HTML (placed in text widget)

    <div id="google_translate_element"></div>

    Site is https://photostories.cc. Widget is in bottom right footer.

    I can provide any further info you need, thank you for the great piece of software!

    https://ww.wp.xz.cn/plugins/autoptimize/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Frank Goossens

    (@futtta)

    you’ll have to exclude the inline JS as well, you can do that by adding “googleTranslateElementInit” to the comma-seperated list of JS exclusions.

    hope this helps,
    frank

    Thread Starter goferit

    (@goferit)

    Done like dishes!

    You’re the man, Frank!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Issue with Google Translate widget’ is closed to new replies.