title: Auto Detect Language of a User IP address and select for google translator
body: <p>I use google website translator for my website which lets the user select a country from the dropdown list. Google does the webpage translation. The code is below:</p>
  
  <pre><code>    &lt;div id="google_translate_element"&gt;&lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  function googleTranslateElementInit() {
    new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
  }
  &lt;/script&gt;
  
  &lt;script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>However, I want a way to let the website detect the user's IP and translate automatically based on the result.</p>
  
  <p>For example, a user who only understands French visits a webpage that says "Click ME to Translate to French". Unfortunately the French guy wouldn't be able to know that what the text says. So I would really appreciate help here.</p>