Created
September 28, 2024 07:45
-
-
Save reddgr/b6ba43972ab34256318ad6bad038f98f to your computer and use it in GitHub Desktop.
Quickly add a Google Translate widget to your website
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="google_translate_element" class="google"></div> | |
<script type="text/javascript"> | |
function googleTranslateElementInit() { | |
new google.translate.TranslateElement({ | |
pageLanguage: 'en', | |
includedLanguages: 'en,es,fr,ca,eu,gl,it,pt,de,cn,ar,hi,bn,ru,ja,el,iw,pl,sv,ro,no,ko,nl,da,th,vi,el,uk,sl,sr,sk,tr,fi,lv,lt,et,id,hu,hr,ur,ms', | |
layout: google.translate.TranslateElement.InlineLayout.SIMPLE, | |
gaTrack: true, | |
targetLanguage: 'en' | |
}, 'google_translate_element'); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment