How do I make my Google Translate widget work properly on my published site

I work internationally and tried to add a Google Translate widget to my published (iWeb made) website. I copied the widget code directly from Google and attached it to the HTML Snippet on my iWeb site. Once I upload it to the www, it doesn't work at all. I also tried the Bing widget (Microsoft's translation widget) and it's no working either.
I was wondering if the translation widgets are compatible with iWeb and if someone could help me.
I am attaching the posted code (just in case there is something wrong in it. Thanks in advance!

<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google translateelement');
}
</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateEleme ntInit"></script>

13' MacBook Pro 2.26 Ghz Intel Core 2 Duo, Mac OS X (10.6.3)

Posted on Apr 10, 2010 10:48 AM

Reply
5 replies

Apr 10, 2010 3:09 PM in response to Mitxel

Hello and welcome to the discussion. You can not just copy and paste this code to a html widget, you must "insert" it using a software like MassReplaceIt for example.

Just create a text box in your Iweb page and place it where you want your widget to appear.

Publish your site to a folder

Open MassReplaceIt software and on the first tab just enter the text you put in Iweb in the first box, for example: "GoogleTranslateWidget" and in the second box paste the code you provided in your message.

Apply to all your site (You can copy the text box on all your pages if you desire).

Upload your file to your hosting company and look at the result.

Work great for me, look at my page http://www.wesdotphotography.com/Home.html and try it (the only drawback is that your site might look funky when translated).

Good luck
Thierry

+PS: I may receive compensation via google ads if you visit my site.+

Apr 10, 2010 8:23 PM in response to Mitxel

I work internationally and tried to add a Google Translate widget to my published (iWeb made) website. I copied the widget code directly from Google and attached it to the HTML Snippet on my iWeb site.


it does not work because iweb 'html snippet' deceived you.
any time you add anything to html snippet, iweb creates another page and let you see it thru an iframe... see my explanation for Statcounter here (also apply to other code as well):
http://discussions.apple.com/thread.jspa?messageID=8895690&#8895690

------------------
that said, it can be done with ajax/javascript and controls from the inside iweb, here is example built with my widgets: http://www.cyclosaurus.com/temp/G_Translator/

this requires knowledge of ajax/javascript/DOM and inside working iweb and no post editing.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I make my Google Translate widget work properly on my published site

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.