Last active
July 11, 2020 05:02
-
-
Save krmanik/756c18f7176dccf015ea7ea72c94724a to your computer and use it in GitHub Desktop.
Add Google translate option to a a page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="translate_this_page"></div> | |
<script type="text/javascript"> | |
function googleTranslateElement() { | |
new google.translate.TranslateElement( | |
{pageLanguage: 'en'}, // Language can be changed here | |
'translate_this_page' | |
); | |
} | |
</script> | |
<script type="text/javascript" src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElement"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment