Need help with Google Translate

Discussion in 'PHP' started by kevinpham123, Nov 16, 2012.

  1. #1
    I am trying to figure out how to use Google Translate ( http://translate.google.com/translate_tools ) to load a page in English but convert it to french without someone having to click the "translate to french" link. The page loads in English and will translate to french, dutch, etc. if I click on the link to do so but since this will be displayed to french speaking people, and because I can't convert it to French beforehand, I need it to load in French.
     
    kevinpham123, Nov 16, 2012 IP
  2. amcd

    amcd Active Member

    Messages:
    7
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    88
    #2
    http://www.php.net/manual/en/function.http-negotiate-language.php

    You can find out the preferred language as set in the user's browser. Then, show the page in the appropriate language. Of course, this presumes that your server is capable of showing the pages in those languages.

    An alternative would be to trigger the google translate function using javascript after the page has loaded. This needs more research and I don't have a step by step guide ready.
     
    amcd, Aug 13, 2013 IP