Created
February 1, 2011 19:27
-
-
Save carolineschnapp/806456 to your computer and use it in GitHub Desktop.
Google Translate Embed Code
This file contains hidden or 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"></div> | |
<script> | |
function googleTranslateElementInit() { | |
new google.translate.TranslateElement({ | |
pageLanguage: 'en' | |
}, 'google_translate_element'); | |
} | |
</script> | |
<script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> |
I implemeted in reactjs, but I want show loading when api call. how i can implment or how i can get api loading state.
Hello Guys,
i really want a translator that i can customize with the country flag. i have seen some used this google code
<script> function googleTranslateElementInit() { new google.translate.TranslateElement( {pageLanguage: 'en'}, 'google_translate_element' ); } </script> <script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> and it was customized.Now i want to use this same code for translation in this my fellow websites Get Backlinks, Plus Naija and Heartlandngr. please who can assist to use country flag in this translator.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is working for me (I build sites on a 3rd party platform) but the default menu language is coming up in the geographical local language (in this case Thai).
<script type="text/javascript">// </script> <script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit" type="text/javascript"></script>I tried a Google "expert" who insisted that the menu language is decided by your Chrome language settings, but he was full of crap. I have no Thai settings in my browser, or on my laptop at all. It's not even an alternative language choice in Windows or Office for me.
I insist that it's being decided by location but he disagreed.
To check, I set the following code in my website:
.. and it comes up as Thai (as I am in Thailand).
When I was last working in Zambia, it came up in English
To verify, I connected via a VPN to a server in London and, lo and behold, the menu language changed to English! I simultaneously checked the exact same website on my phone (not connected via VPN) and it's still in Thai.
Anyone know how to lock the menu language to English (or another language, come to that)?
Thanks peeps.
sam