How can we use google translator api on my website

Well, I want to use the google translator api on my website, and when I put this api code on my html page, it works 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"></script>

I want to put the code when I put this code in an iframe, then it shows everything.

But when you change the language, it changes the language of the elements in the iframe, it does not affect the external iframe.

+3
source share
1 answer

I think that’s why the iframe tag is used to include an external document in an existing one.

Google Translator iframe, .

. :

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

+2

Source: https://habr.com/ru/post/1734230/


All Articles