Question

How to translate English langauge text to a foreign language with google translator via JavaScript without showing a google toolbar?

Was it helpful?

Solution

OTHER TIPS

Caution about Google API!

You can send no more then 5000 symbols for translation. And after some requests (about 500) you will be simply banned.

Good luck !

add meta tag is header

<meta name="google-translate-customization" content="b6703fd8b1d84044-bd4dd2611d59f8dc-g6a8fe920a18c8f60-d"></meta>

add belo code where do you want

<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top