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/AVvXsEit5LvSz-DC_Qry0bX6Bi9RgFoJ0RNVyNy58BAG9RKAU3mXsl4UPQAdg5yLEphW-rNS8CZdc2eQF3O1qYydvpJu0pjp5oIPJ3JqWkRGbWaMrcSkbgzbs_fofwrSbnF8SreRjq6znZS_tddk/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/AVvXsEhydMNXNY2kWL-fFmE_I8zWy6INqr9mHoWPflpMIbhCGOKYJYA3t8017Ru52EWWIgyg-N10sGKRTmbZBpMVtAbiEiL_p2I7Z4cMh89YF39lwOHFQqsy_DZQMqefhw7CBRZsXLsrtQYiHrLO/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/AVvXsEgtXr7xvAbfYMAGGPPoDyZlzOTUMTQgjVvYNIjL8xO2FeArDs6nY3BSeqSmbMcUKi0p8wDqmusj1OX6xscpww30J3VCUhhpQrRUIqLyzVQtnP9I13aqbrGQ8tjun_wagz-Zp0Ymc166MscS/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/AVvXsEjTmzLAiwdxk2kBzWbkiwQ6dq4xiXbMAtcWVg21uqUDzEwIogeOxvWZTvWKYiYa9eDYyRL8Htzpzr8a3oZcgMHtGcJm7amLS7KQL-csc5L2sp0Vj6Xn5C_zu5CCQR8NdZSpCVZpOmD5aamW/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/AVvXsEjBjcoaDDHZIsp9LIy1jjYvl249wF8JHaW6uTW3gYKFx-MBUDEVq4FL2cclL6m4C7rPPhG1u9nqZ5tHuRU6rfRKbxBI81gTw98_nT9xtLOzvw2GTGka6NxVLiWBvZnALinpHTvQgerH0aK1/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/AVvXsEjectYFVo_dbFhViMel04y8UwxyGe-va9laBAtnnCiob-bPg16YtamU2F_LnI9TgLot92COS0ULn3zFFR5wTiFbodEN4LEL5WwKRmt2QfQQ2QMIgFvVs2ipTA4cL_GcMO0LWjtkKPu9kIjv/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/AVvXsEjTn-2HwggQou3S7tMtGJMmvFfy2VRv-KEU44mbMvFpGmAmWrICeVnlS9INAdjXRWgwfruiKRpIea-H16q3tS7ov4sX8c-T6gMKbfG6NSGjhVB7CXcMZYtew3SdnLd8R7mLAS6uUXWTCelv/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/AVvXsEi89WgX4ghOm_7QghfEIsJlA7WAGrHe1tbAsDCFZZ7zobhrIRyX5rTQ3jR_53FUhc6fl2NtL1JYTQ8ZWNVLow34xsXzgUOGSj6Wp51t9yH9YJcNNLRx1w0N3aYWA0VGJE1aCT_Pb39pI_uu/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/AVvXsEhhzHKYgyALnc5U60peBLPcjUWKw3nnup_HnGiVyzqaiQQ3PsX5A8RKq2BuVIWoG8eKdmkIhWfQ_ldixqnzjpzPIdPONLzZ7GrHhyphenhyphenDZuOVSMCk2zn4fmHndbFH_MgYG30s8osxpp78DUOkc/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/AVvXsEjKASmvyCszVFCGsTij70ltNLWFmFM59iH0DD5eRWO-MtTpEMNcpXAQweaBNlo8q5sn-JL9RwXtXZjy2MJaic5f1bLDoJGHkYdeK3c_AmtyNPGGl9SxndJha5SO4zs2H3nQ_PbDKNdgORjC/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/AVvXsEiW4gg1jiu2IFmNHWluET7ayo18gdMSLfGma7E7q3yt2jhH9UhxyJzqUDSFn4UKd3ce8wR44Col59U4a4dTq3puSsthO3vT2PT2Z5mi-ehYS6iY1E9kiaHrlEKdTQpFMvFtkHxk0xq3pSAG/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/AVvXsEhum7oX86DrRRzOFLuAmPhSA5fGoIn72gvwrXQJBLEMcfcz2ltskJxDxZKzSo9yAgPAD17YNEGDKn5G7ji-XE7Nvz1qn-PlQT2mylJcmR424tZnJvov7qu38yoZCxXgz6aThja4grqgRMI0/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