• Resolved justpanda

    (@justpanda)


    I have a site in Russian and I need it to be displayed in Ukrainian by default. I wrote to the chat, they gave me the code:

    
    <script type="text/javascript">
    setTimeout(function(){
    if(localStorage.getItem("ChangeLanguageFirstTime") === null) {
        doGoogleLanguageTranslator('ru|uk');
        localStorage.setItem("ChangeLanguageFirstTime", true);
    }
     }, 3000);
    </script>
    

    This code does not work for me. I tried various positions of the code, I thought that the problem was in the theme. I tried to write in functions.php and call functions from different places too. Tried calling the function without checking “ChangeLanguageFirstTime” and without “setTimeout”. I checked the results of each test through private tabs. After a huge number of tests I gave up. Are there any alternative methods? Or maybe you can identify or suggest what the problem might be. Thank you

    • This topic was modified 3 years, 10 months ago by justpanda.

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

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

    (@edo888)

    Hi,

    The code looks fine. Make sure to check it with incognito window as it will work only once, make sure that you do not have Auto switch to browser language option on as it may conflict.

    Currently I do not see the code on your website.

    Thanks! ??

    Thread Starter justpanda

    (@justpanda)

    Yes, I checked it every time through incognito. Yes, at the moment, after all the tests, I removed the code, tell me where to find the Auto switch to browser language function? Pasted the code back.

    • This reply was modified 3 years, 10 months ago by justpanda.
    Thread Starter justpanda

    (@justpanda)

    So. It turns out that you have two very similar plugins, I just deactivated and removed one, found and installed another, tweaked the code and everything worked as cool and correct as possible. Suddenly, who will have a similar situation, send to this topic. And
    @edo888 thank you very much for always responding promptly to all requests, this is really cool)

    Plugin Author edo888

    (@edo888)

    Oh, I did not realize that you are using our GTranslate plugin, but posted a code for Google Language Translator plugin.

    So yes, you just need to use doGTranslate function instead of doGoogleLanguageTranslator.

    Thanks! ??

    • This reply was modified 3 years, 10 months ago by edo888.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Default translate language’ is closed to new replies.