Saturday, February 8, 2014

Google Translate Widget with Flags For Blogger


This widget also auto-detect your blog language and then translate it to the readers chosen language.

It supports 12 different languages:
English, French, German, Spanish, Italian, Dutch, Portuguese, Russian, Japanese, Korean, Arabic And Chinese.

How To Add The Google Translate Widget To Blogger

Step 1. Go to your Blogger Dashboard >> Layout and click on "Add A Gadget" link



Step 2. From the pop-up window, scroll down and choose HTML/JavaScript


 Step 3. Paste the code below in the empty box:

<script type="text/javascript">
function showHide(shID) {
    if (document.getElementById(shID)) {
        if (document.getElementById(shID+'-show').style.display != 'none') {
            document.getElementById(shID+'-show').style.display = 'none';
            document.getElementById(shID).style.display = 'block';
        }
        else {
            document.getElementById(shID+'-show').style.display = 'inline';
            document.getElementById(shID).style.display = 'none';
        }
    }
}
</script>

<style>

 .google_translate img {
margin: 10px 20px 0px 20px;
    height: 24px;
    width: 24px;
        }
        .google_translate:hover img {
filter:alpha(opacity=0.30);
        -moz-opacity: 0.30;
        opacity: 0.30;
        border:0;
        }

.more {
    display: none;
a.showLink, a.hideLink {
    text-decoration: none;
    color: #0880C4;
    padding-left: 18px;
    background: transparent('down.gif') no-repeat left; }

a.hideLink {
    background: transparent url('up.gif') no-repeat left;
color: #0880C4;}

a.showLink:hover, a.hideLink:hover {
color: #0880C4;
 }

 </style>

 <div>

 <a class="google_translate" href="#" target="_blank" rel="nofollow" title="English" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=auto%7cen&hl=en'); return false;"><img alt="English" border="0" align="absbottom" title="English" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj9ziZu_bd9G6QzvnDGXCKi0LSm0RR4qB9vNNykpY5so7SNPJfhNX0aMLBW0zgPLjDrd5eVmpQM3SqzUyZfJFIJY1gThcBdqXw2m2R20i1WV5tj16GOC1kHxEyaylcADLkIbwP1VZ8NbVW/s1600/United+Kingdom(Great+Britain).png" style="cursor: pointer;margin-right:8px" width="24"/></a>

 <a class="google_translate" href="#" target="_blank" rel="nofollow" title="French" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=auto%7cfr&hl=en'); return false;"><img alt="French" border="0" align="absbottom" title="French" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUxbv2gQ9XTiC-G_f8c0KgG09I5s1fl1RxsHAShY8P52HBvcNN4MvJEV6kX5m-iUJ1Lm0etC3qQoYY8jsxvM3Tzn8he6F57xEauo0LnXDRG5qj4tnMFIFd_gO02159pS74UFW5TMG7mh6G/s1600/France.png" style="cursor: pointer;margin-right:8px" width="24"/></a>

 <a class="google_translate" href="#" target="_blank" rel="nofollow" title="German" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=auto%7cde&hl=en'); return false;"><img alt="German" border="0" align="absbottom" title="German" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCzkPCY_mj7q5XHCCry1cXV85gp1GUGMpL473GwxOEuBeNymFsd0Qn5hbtTj9KQXYeG8ynGCQwjyUH877N7CLn-tigrJFjWjWYqcLm8W86K5nJKS_DYljqI4FevgTNpsMgVzlHxk2wOrzz/s1600/Germany.png" style="cursor: pointer;margin-right:8px" width="24"/></a>

 <a class="google_translate" href="#" target="_blank" rel="nofollow" title="Spain" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=auto%7ces&hl=en'); return false;"><img alt="Spain" border="0" align="absbottom" title="Spain" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4B9lCdy1mohvFb0uGA7a3xxkKlWQ3gJkkrbRIMm-LZwuBmfanUPTsUifo6DRpAepLwRj-bmB0HZFGWQflr4SbGCM88lIk3bs45kR3ltSYH-kGKVguW8-TOA_7U3lH1C2_QLmEtwKmo5fH/s1600/Spain.png" style="cursor: pointer;margin-right:8px" width="24"/></a><a href="#" id="example-show" class="showLink"
onclick="showHide('example');return false;">More</a>
<div id="example" class="more">
 <a class="google_translate" href="#" target="_blank" rel="nofollow" title="Italian" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=auto%7cit&hl=en'); return false;"><img alt="Italian" border="0" align="absbottom" title="Italian" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhjevyfEM7cnAkAhyqj6OkTc2lUepYBgS9BlTZtYl1z4xw-f7MaDwh5uRTNmkSovnLLeUkNzFWaShSW6HmQ6S8rdrJtWbYPPeX1rpVx2Z5wXwIxvcGAjvdOW5j8pkqnFVXeEZhvhfCjRXe/s1600/Italy.png" style="cursor: pointer;margin-right:8px" width="24"/></a>

 <a class="google_translate" href="#" target="_blank" rel="nofollow" title="Dutch" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=auto%7cnl&hl=en'); return false;"><img alt="Dutch" border="0" align="absbottom" title="Dutch" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFHtWQBmNYoS3kRLySyC2usDhT2vDix9pKCJcOeoXVdeS7fU2wkiFYk4t5rAp3H1QHt_Po09X50Ljln0iYQHnEoL1FF49aecag-FTobsGyP0YYS4Ho5z3YWHxiT7yOO557GO8pnLBNjJ8E/s1600/Netherlands.png" style="cursor: pointer;margin-right:8px" width="24"/></a>
      <a class="google_translate" href="#" target="_blank" rel="nofollow" title="Russian" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=auto%7cru&hl=en'); return false;"><img alt="Russian" border="0" align="absbottom" title="Russian" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3oQDglR0aLh9XkwsEA6jdxshvVYZvfrQiosB7CMiqSvaEtUniUp0fZ-Baq3BRDXA4VyDYNPOMF0aCbeYMEcAtpvp0VGE5cI_-Fd53v658O4orX_jkxK3izbC8EKn7EFHMxjYDOW7yVfIb/s1600/Russian+Federation.png" style="cursor: pointer;margin-right:8px" width="24"/></a>

 <a class="google_translate" href="#" target="_blank" rel="nofollow" title="Portuguese" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=auto%7cpt&hl=en'); return false;"><img alt="Portuguese" border="0" align="absbottom" title="Portuguese" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcb5wn_DvH-BR7EHiSKsF5bead-fjX5UrM_fGlK7voTPDaB81sav0jsraVEARdoQ5XAoHmW8jzS_tAXqGUGfy4lIUuDPqyBciT7C1RMveSoqgnaep3WK0iONbBNFBGhMoEbNInpbrZp2td/s1600/Brazil.png" style="cursor: pointer;margin-right:8px" width="24"/></a>
<br />
 <a class="google_translate" href="#" target="_blank" rel="nofollow" title="Japanese" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=auto%7cja&hl=en'); return false;"><img alt="Japanese" border="0" align="absbottom" title="Japanese" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6TpopsRhMreCBtyB09l9Wi-SWVLPC8m9xJkHycMyZuQ9mXGe31ZPXB3ENGrqqjuo0VBl2iF2HFEyVm5ikeJ_wCoIgFtFXUzHpoJWM2IBW1lKQNy4KQX8ExR0B73xdPPwcBoT1pr1EXsol/s1600/Japan.png" style="cursor: pointer;margin-right:8px" width="24"/></a>

 <a class="google_translate" href="#" target="_blank" rel="nofollow" title="Korean" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=auto%7cko&hl=en'); return false;"><img alt="Korean" border="0" align="absbottom" title="Korean" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgr2Bkx5g56go6Xu0oJ-SfvTte_4RsUa8Fc2INAcJPDi8SnHLRdH_sOo8JKDHMTbe5rCnTl9zq3HslKsNeeYLMG7MKeedeghUE_PUTzljg3ouQl2eOBJVuB4BT5wM327AdV0BCM9FAAEq5-/s1600/South+Korea.png" style="cursor: pointer;margin-right:8px" width="24"/></a>

 <a class="google_translate" href="#" target="_blank" rel="nofollow" title="Arabic" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=auto%7car&hl=en'); return false;"><img alt="Arabic" border="0" align="absbottom" title="Arabic" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEwIH0B5DhqtsZsAHOvBKVJNfGYmOoh6ty1xj0Q1xbB3OecWXNhriZY6bxsfaxfY5QYrjnFSS1Kz0EmWMa0LLigSQemOF0Ff2510DzseUdcJtMi2mmBf9S8LZw0K4pGBkAe2VUiHf802WB/s1600/Saudi+Arabia.png" style="cursor: pointer;margin-right:8px" width="24"/></a>

 <a class="google_translate" href="#" target="_blank" rel="nofollow" title="Chinese Simplified" onclick="window.open('http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&langpair=auto%7czh-cn&hl=en'); return false;"><img alt="Chinese Simplified" border="0" align="absbottom" title="Chinese Simplified" height="24" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7_xy28sHYA__rDJNrabMQdk8KVN-xxUFU5EIMbDMQmoIF73rU2hbeLMzn_M8lw8aDL4p4CSY_ap6x4cD1Ouzf9WmTKSd3Gc3kzybPnae_Gw921HpP9jJtAN6ifnfJ2L8pKxK6NkuPdTmz/s1600/China.png" style="cursor: pointer;margin-right:8px" width="24"/></a>
    <p><a href="#" id="example-hide" class="hideLink"
    onclick="showHide('example');return false;">Hide / </a><a href="http://helplogger.blogspot.com"><font size="1px">Get this widget</font></a></p>
</div>
     </div>

Step 4. Now click on Save

google translate, blogger widgets, gadgets for blogspot
And you're done! Enjoy (:

No comments:

Post a Comment