I am using Google Translator code to translate website in languages.Following is my code...
<div id="google_translate_element" style="padding-left:347px;"></div><script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'fr'
}, 'google_translate_element');
}
</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
It is working fine.But I want to use it according to the country.When website is opened in France it will be set to french , in India it will be Hindi and so on...
How to use this??? Or is there any other way to achieve this kind of task in php.
I thought if I get country language in some way then I will pass it in pageLanguage .But when I pass "fr" it does not changed to French.Also how to get country code,language using hostname.