• Resolved rakibmhar1

    (@rakibmhar1)


    I wanted the site to be loaded in different langugage. I use the <script> on footer using a code snippet plugin. the language is not changing. Kindly help me on this.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rakibmhar1

    (@rakibmhar1)

    Used this code already.

    <script> if (typeof(Storage) !== "undefined") { 
    if (localStorage.getItem("ChangeLanguageFirstTime") === null) { setTimeout(function() { 
    const element = document.querySelector('a[data-gt-lang="es"]'); 
    if (element) { 
    element.click(); 
    localStorage.setItem("ChangeLanguageFirstTime", true); 
    } 
    else { 
    console.error('Element not found!'); } }, 3000); 
    } 
    } else { 
    console.error('localStorage not supported in this browser!'); 
    }
    
    </script>
    Plugin Author edo888

    (@edo888)

    Hi,

    Good approach. You can also try this:

    <script>
    if(localStorage.getItem("ChangeLanguageFirstTime") === null) {
        document.cookie = 'googtrans=/en/es';
        localStorage.setItem("ChangeLanguageFirstTime", true);
    }
    </script>

    Thanks! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘I wanted to translate the site while first load. Now it is in English .’ is closed to new replies.