I have a web page created in English. Depending on the continent, I want to dynamically translate my whole webpage to another language.
The webpage is fairly complex, so I cannot do it string by string. I just want to do it in a way like at the time of loading it will get translated into desired language.
Can I translate my webpage using the Google Translate API?
Here is an example to to add Google translator to web page to translate specific element:
<html>
<head>
<title>My Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="translate">Тестирование</p>
<div class="translate_control" lang="en"></div>
<script>
function googleSectionalElementInit() {
new google.translate.SectionalElement({
sectionalNodeClassName: 'translate',
controlNodeClassName: 'translate_control',
background: '#f4fa58'
}, 'google_sectional_element');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=en"></script>
</body>
</html>
http://jsfiddle.net/maxim75/H3Wkr/ - working example
You could add a Google Translate widget to you page and users can translate to their language of choice on demand. http://www.google.com/webelements/#!/translate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With