views:

557

answers:

1

well i want to use google api translator in my website and when i am putting this api code in my html page its working fine.

----------------------------------google translator code :-----------------------------

<div id="google_translate_element" ></div>
<script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en'
  }, 'google_translate_element');
}

</script><script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"&gt;&lt;/script&gt;

i want to put the code in when i am putting this code in iframe then it shows everything.

but while changing the language it changes the language of elements in the iframe it doesn't effect outside the iframe.

A: 

I guess this is why the iframe tag is used to include an external document into an existing one.

Google Translator will translate the content of the iframe only, since it has no clue about the container document.

Please see also:

http://forums.macrumors.com/showthread.php?t=467248

Roberto Aloi