Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to integrate google auto translator into an iFrame?

    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!

  • #2
    Regular Coder mbaker's Avatar
    Join Date
    Jan 2010
    Location
    Burford, Oxfordshire, United Kingdom
    Posts
    249
    Thanks
    1
    Thanked 39 Times in 39 Posts
    In your iframe:
    Code:
    <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.
    - Michael Baker - HTML Tags Guide - Reference and Tutorials
    - Like voting, validate early, validate often - W3C HTML Validator - W3C CSS Validator
    - Wot? me cynical? no, its just if you vote, er, validate early, you have more chance of validating often.

  • #3
    New to the CF scene
    Join Date
    May 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •