-
-
Save carolineschnapp/806456 to your computer and use it in GitHub Desktop.
<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> |
Sadly it does not work anymore, google stopped there widget service
Sadly it does not work anymore, google stopped there widget service
nope, still works, tried and confirmed right now
Yes working
Got the following message in Firefox Web Console.
Blocked loading mixed active content “http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit”
Loading failed for the <script> with source “http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit”.
I was looking for translate iframe webpages from my website. Any ideas?
It´s an english manual of programming: https://www.linguagemclipper.com.br/manual-harbour
I need to translate to portuguese.
My Web Page
Hello everybody!
Translate this page:
<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>does this work for instapage?
Do I put it in JS or CSS/HTML?
Works for me today. Thank you for putting this up :)
Just Add this Script and setup your language and your google translate html code is ready.
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>
Is there a way to change this so that the script adds rel attributes to the following link that's added to my site?
<a class="goog-logo-link" href="https://translate.google.com" target="_blank" rel="noopener noreferrer"><img src="https://www.gstatic.com/images/branding/googlelogo/1x/googlelogo_color_42x16dp.png" width="37px" height="14px" style="padding-right: 3px" alt="Google Translate">Translate</a>
how can we provide the default language for the page so if people coming to website have different default language google can translate
worked in localhost not on the live site
The LANG tag (i.e. the lang="" attribute) is designed to signal screen readers pronunciation engines to switch to another language. For this reason and other, tagging Web text as being in a particular language is required in WCAG 2.0.
Declaring a U.S. English Page (Penn State)
...While this translate code did work for me, sometimes but not always, back in January 2021, I had to delete it from all of my code as it had become more and more unreliable with the passing of time. All browsers provide access to the extension for translating words. phrases, and whole web pages. Check out this link for Chrome for example...
https://chrome.google.com/webstore/detail/google-translate/aapbdbdomjkkjkaonfhkkikfgjllcleb?hl=en
It does not work for me any more. It worked on my website since 2015 until this week. Has Google stopped supporting it?
Update: It started working again the next day - so just temporary downtime from Google.
Using:
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>
...works just fine for me as of today (setup on a new website).
Yes, it now works for me too. I meant to write back to say it started working the following day. So there must have simply been a tempory issue in July.
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).
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
It's very easy to make some words bold and other words italic with Markdown. You can even link to Google!