...

View Full Version : How to integrate google auto translator into an iFrame?



jaonhtna
05-14-2010, 04:40 PM
Hello,

I have a simple question for you, but a very difficult for me.

I want to integrate the code of google auto translator:

<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'bg'
}, 'google_translate_element');
}
</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

into the iFrame:

<p align="center"><iframe height="1200" width="600" src="http://www.40019.sr-linkagent.de/ferienhaus" align="middle" border="0"></iframe></p>

When i'm compiling the codes together, i'm getting auto translating in the web page (menu, text, buttons), but not in the iframe.

Can anyone help me?

Thank you in advanced!

mbaker
05-14-2010, 06:20 PM
In your iframe:

<iframe height="1200" width="600" src="http://www.40019.sr-linkagent.de/ferienhaus" align="middle" border="0">
Have you considered replacing http://www.40019.sr-linkagent.de/ferienhaus with a URL that gives a translation of that page, such as http://translate.google.com/translate?hl=bg&ie=UTF-8&u=http://www.40019.sr-linkagent.de/ferienhaus&sl=de&tl=bg

I obtained the second URL by visiting http://translate.google.com/ , translating the first URL and experimenting. It may be possible to construct a URL that does not display the google translation frame. On the other hand, doing so may violate the Google TOS.

jaonhtna
05-15-2010, 11:57 AM
Thank you mbaker for your advise.

Also my point was to actually having auto google translating into my site and not everytime to get redirected to translate.google.com. :(

I want my site to be tranlated, like in google chrome browser, with the language bar on the top, without getting redirected to translate.google.com

The above code does this thing, translating the page, without redirecting:

<div id="google_translate_element"></div><script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'bg'
}, 'google_translate_element');
}
</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>


Thank you in advance!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum