• Resolved 1zboro1

    (@1zboro1)


    I’d like to ask if I can make GTranslate to automatically translate website if visitor is from outside Poland? Websites main language is Polish. Maybe there’s a function to retrieve browsers language? I tried something like this to check browser language:

    <?php
    $local = get_user_locale();
    echo $local;
    ?>

    All it echoes me is still pl-PL even if I set browser language to English (US). I want to write a code that:

    if($local !=='pl-PL') {// inject googtrans cookie with value of '/pl/en'}

    I think that would translate page after it loads. If there’s any better way to force automatic translation depending on browser language or user location I’d be thankful to hear about.

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

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

    (@edo888)

    Hi,

    We do not have geo-location based support. We have Detect browser language feature which checks the browser language.

    You can check the source code of js files to see how it is implemented and possibly modify it to your needs.

    Thanks! ??

    Thread Starter 1zboro1

    (@1zboro1)

    Hi,

    could you point me at what should I do or change in your code to make plugin translate website if somebody with browser language different than Polish enters?

    Plugin Author edo888

    (@edo888)

    Hi,

    I think you just need to turn on “Auto switch to browser language” option from GTranslate plugin settings page.

    Thanks! ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Automatically translate if user’s is from abroad’ is closed to new replies.