Support » Plugin: Translate WordPress - Google Language Translator » Plugin is activated but not seen on the website

  • Resolved taavi_miku

    (@taavi_miku)


    I remember it working well but recently I noticed that there’s no translation option on the site anymore.
    I have Google Language Translator status activated, website original language as well as target languages chosen, the language switcher set to show switcher, etc., but yet I can’t see the option on my site upper right corner where it should be. I see there is a corresponding div but no actual switch with the language menu.
    What’s wrong? What I should do to make it appear there?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author edo888

    (@edo888)

    Hi,

    First thing I have noticed is that you have a javascript error logged in the browser console, make sure to fix it.

    Also it seems that your theme is not rendering footer scripts (PHP wp_footer function is not called), that can be the reason.

    If you cannot find a solution with your theme, try our other plugin: https://wordpress.org/plugins/gtranslate/

    Thanks! 🙂

    Thread Starter taavi_miku

    (@taavi_miku)

    Thanks for your reply! As I’m not too literate in the code, can you advise me on how I could get rid of that Javascript error and what I should do to make my theme render footer scripts?
    First, I deactivated a plugin that seemed to be the culprit of the error but had no success in terms of the Translation plugin.
    I run my custom child theme with corresponding PHP files and CSS code. What file do I have to modify, what I should add or remove in code in order wp_footer function to be called?

    @edo888 I seem to have the same issue as OP here. My theme is calling the translator via shortcode, and is generating an empty div where the translator should be being displayed with the ID google_language_translator

    I can confirm that Translate was displaying successfully in the past on my site, my theme is calling wp_footer function, GoogleLanguageTranslatorInit javascript code is initialized in my HTML source, and I’m not seeing any JS errors. Anything else you can see that might be worth checking on?

    Running WP 5.8, plugin version 6.0.11, https://berkshirerta.com/

    Thread Starter taavi_miku

    (@taavi_miku)

    Hi! How come the issue is resolved? What is the efficient solution?

    Plugin Author edo888

    (@edo888)

    @taavi_miku

    The proposed solution was:

    If you cannot find a solution with your theme, try our other plugin: https://wordpress.org/plugins/gtranslate/

    You need to check your theme and make sure it calls wp_footer function to render footer scripts, if you do not know how to do it, I recommend contacting your theme developer, as it will require coding skills. You can also consider using a different theme or our other plugin which does not depend on wp_footer scripts.

    @rdaskew Please feel free to open a new support topic and I’ll look into the issue for you: https://wordpress.org/support/plugin/google-language-translator/#new-topic-0

    Thanks! 🙂

    Similar issues to the OP. What happens if you try your gtranslate and that does not work either? Is that also a wp-footer error?
    My issue is that the original Google Language Translator plug in worked until recently but now does not, UNLESS you are logged into the site admin and viewing the front end in the same browser but another tab?

    Thread Starter taavi_miku

    (@taavi_miku)

    I don’t know exactly what calling the function means, but I see that my custom theme pulls the theme’s footer.php file along with other PHP files like child/functions.php, functions.php, etc.
    Also, there has <?php wp_footer(); ?> function in the footer.php file. Isn’t that enought or correct?
    To make sure that no plugin causes the problem, I turned them off and back on one by one. No one plugin made any difference to the issue.
    Eventually, I got rid of Google Language Translator and installed GTranslator instead. It works just fine.

    I tried both plug ins, neither works for me. The Google language translator did, but then stopped (not sure when)
    It does work when I am logged into admin, when not logged in I can see a JS error

    } else {
            event.value = lang_dest;
            if (lang_prefix != default_lang) = uncaught typeerror cannot set this property value{
              simpleValue.click();
            } else {
              jQuery('.goog-te-banner-frame:first').contents().find('.goog-close-link').get(0).click();
            }

    Above code heading hass this comment in it
    Script for onClick trigger functionality used by flag images
    * Script modified from original GTranslate plugin created by Edvard Ananyan at http://edo.webmaster.am
    * GTranslate Free Version is licensed under GNU/GPL license

    I am still investigating.

    Plugin Author edo888

    (@edo888)

    @taavi_miku That is great! 🙂

    @robmcp Please feel free to open a new support topic and provide your website address and I’ll look into it for you: https://wordpress.org/support/plugin/google-language-translator/#new-topic-0

    Thread Starter taavi_miku

    (@taavi_miku)

    I think I’m quite close to the cause of the issue, but as I’m rather clumsy with the code, I hope someone more knowledgeable can pick the clue up from here and provide the final solution.
    So, even though I have deactivated and deleted the Google Translate plugin, I could make it appear on the site with the help of the browser Dev Tool. I spotted the corresponding div element in the header and made it appear by unchecking display: none!important; in style tab in Dev Tools. As much I understand this line of code resides in a category file, but unfortunately, I can’t find that file.

    Plugin Author edo888

    (@edo888)

    @taavi_miku Absolutely no clue what you are trying to solve now, since you are using GTranslate currently.

    As I have explained earlier the cause for the initial issue you have described is that our scripts are not in your footer section, because your theme is not calling wp_footer function properly or some plugin is messing with the wp_footer scripts and removing them before your theme calls wp_footer to render the scripts.

    When wp_footer is called properly you should have something like this in your HTML source code:

    <script>function GoogleLanguageTranslatorInit() {...

    Thanks! 🙂

    @edo888 can I PM the URL, it’s on a staging site.

    In my source of a page this is one one page

    <div class="cli-modal-backdrop cli-fade cli-popupbar-overlay"></div>
    <!--googleon: all--><div id='glt-footer'></div><script>function GoogleLanguageTranslatorInit() { new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages:'en,fr,de,it,ko,es', autoDisplay: false}, 'google_language_translator');}</script><script>
    document.addEventListener( 'wpcf7mailsent', function( event ) {
        location = 'https://www.staging.com/contact-us/thank-you';
    }, false );

    I am unsure as to whether or not this means wp_footer is not at fault.

    Thread Starter taavi_miku

    (@taavi_miku)

    @edo888
    First I tried to figure out why there’s no translation option on my site anymore. For now, having deactivated and deleted the questionable Google Language Translate plugin, I wonder why there’s still the code related to it on my web page and how come I can revive the option just by unchecking the display: none!important in the Dev Tools?
    Frankly, I don’t know much about wp_footer function and what part it plays showing the translation widget on the site. Back the times I installed and activated GLT plugin, I put the shortcode to the header section and it worked just fine till recently when it has just gone with no obvious reason. Thus, considering these circumstances I don’t see too much logic in your explanation of what causes the GLT issue. Obviously, something in the WP imposes its disappearance, contradicts the plugin code.

    Plugin Author edo888

    (@edo888)

    @taavi_miku You are currently using GTranslate.

    What code are you talking about? I think you confuse it with GTranslate, both these plugins share some code.

    Thanks! 🙂

    • This reply was modified 2 years, 7 months ago by edo888.
Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Plugin is activated but not seen on the website’ is closed to new replies.