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:
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
However, I want a way to let the website detect the user's IP and translate automatically based on the result.
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.