Paste the code below into your website. The languages โโmentioned in includeLanguages โโin googleTranslateElementInit () will be displayed on your website.
I suggest that you insert this into the header or footer section of the website so that the translation function appears on every page of your website.
<div id="google_translate_element"></div> <script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'en', includedLanguages: 'en,fr,es,it,de'}, 'google_translate_element'); } </script> <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
Also, if you are looking for automatic translation in a specific language, use this code along with the above.
<script> (function() { if(!window.location.hash) { window.location = window.location + '#googtrans(en|fr)'; window.location.reload(); } })(); </script>
source share