Google Translate

By 15 Mar 2010 | Comment
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">

    google.load("language", "1");

    function initialize() {
      var text = document.getElementById("text").innerHTML;
      google.language.detect(text, function(result) {
        if (!result.error && result.language) {
          google.language.translate(text, result.language, "en",
                                    function(result) {
            var translated = document.getElementById("translation");
            if (result.translation) {
              translated.innerHTML = result.translation;
            }
          });
        }
      });
    }
    google.setOnLoadCallback(initialize);

    </script>
    <div id="text">Quel age a tu?</div>
    <div id="translation"></div>

Quel age a tu?


Comments

It's quiet in here...Add your comment

Recent Updates:

09 Feb : Solar PV Readings for Cherwell, east-facing
09 Feb : Solar PV Readings for Cherwell, South-facing
04 Feb : Dodgy connection? Don't just blame your ISP
01 Feb : Cold weather alerts: be prepared!
29 Jan : How to make a cat tree
27 Jan : Be careful what you view on Facebook
26 Jan : Kittens in pose mode
25 Jan : Let the kittens play!
24 Jan : 22 January 2012: Mistley Cross
09 Feb : My Solar PV
04 Feb : About Us: Julii & John Swindells
04 Feb : Internet Access
01 Feb : Domestic Heating Oil Prices: Know the Market!
29 Jan : Cats
27 Jan : The Social Web
24 Jan : Cycling
25 Nov : Piano for the Amateur
14 Nov : Measure
02 Nov : Book Reviews

Popular Searches: