Thứ Tư, 8 tháng 5, 2013

Thêm tiện ích Google Translate cho blogspot

Google Translate Widget cho phép khách viếng thăm dịch trang web của bạn ra nhiều thứ tiếng với ngôn ngữ riêng của họ. Dĩ nhiên các phần dịch này là của Google. Widget này hỗ trợ 12 thứ tiếng là :  English, French, German, Spanish, Italian, Dutch, Brazilian, Russian, Japanese, Korean, Arabic và Chinese.

Các bạn làm theo từng bước sau để chèn widget này vào blog của mình :
Bước 1 : Đăng nhập Blogger--> Chon bố cục--> Thêm tiện ích HTML/ Javascript
Bước 2 : Copy đoạn code sau và paste vào :

[code lang="javascript"]
<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 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/AVvXsEgdJzfkMR1YH0-u2iTYtv2l5niYsMnvk8FDqNYQvYB_e9eZKudpCNzh5ZRut-UfGPFzLvaLzPrMykwui1uECTfYjCNbQax9vZGN5xLqfwANMuiFF8_sdXNFkEalUpRsO-5nW3xCkq97g5mx/s1600/United+Kingdom(Great+Britain).png" style="cursor: pointer;margin-right:8px" width="24"/></a>


<a 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/AVvXsEjDhf6wZ9O9ia_iL5OTuPi0L8CJ4DbOqGs9QSnh0vAgYXvh8Czs9Q4NAv-qydIHHjqlI_1t2UrC237amripfdB4gDmVjkwfgSnSsGAAfx5MDFnUTYdBJUkYzwGkJUB5AVBQqL_MCV70wwYK/s1600/France.png" style="cursor: pointer;margin-right:8px" width="24"/></a>


<a 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/AVvXsEj99GPguQebk1SWu6H9ukKWki363MVXumdfik6Py3v3EcpMRaeHz-dcOxnJq7W16tGHvqgN95epPOfox2INUaDhWqgd3CREYIw84pg5v17PH5EYKokP7jOj9Ez1xwE2HBZg5tnRT6p6O-93/s1600/Germany.png" style="cursor: pointer;margin-right:8px" width="24"/></a>


<a 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/AVvXsEi2NI1kY6OzT-Xb_ooiXWulqq5A8aYiXbsOTEyBTPqZdAvBc2kD3Kik8geLaKi_x17QrNyKvKEgIAfN6HLfS8JA2wssnLI9kvp6hhy4MT6Y_qvieIp0B7tv1K8n-d7p-ZN_8DE3fFiGbW6g/s1600/Spain.png" style="cursor: pointer;margin-right:8px" width="24"/></a><a href="#" id="example-show"
onclick="showHide('example');return false;">More</a>
<div id="example">
<a 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/AVvXsEimaeg9Xv0VtvCLs6begMCwksWAx2oT3Q5zchUgcczHxQmARCV_Z3rmVI2WaD-NFo0JE_hqA1O_o0A-eIUQoyZKmQJNQ9OfCAPTaV0VOpgriF2aKFmsxS4kKa1lh6lmPRnsRZD3J2GZdNln/s1600/Italy.png" style="cursor: pointer;margin-right:8px" width="24"/></a>


<a 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/AVvXsEg-rNsWN7Ishv0DIv8G9QVTiME_hfBFEE_kagoxUrOWBr7ydk_byWl7PQzJ4mn3JN6wzR_Ot47zY1ow4bo0du3BUzCpxg8kYloo8Ma4PK5EYxpjpR5HYgU0UDdZdAj_xFYRnbkngpyTMoMJ/s1600/Netherlands.png" style="cursor: pointer;margin-right:8px" width="24"/></a>
<a 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/AVvXsEiQLdsqBilTEZlo284AiH0dJeW3NOHZ4PXszMv07PihhxAwdewGmUG4oNEsR1VruAMA1mne4XvJdBqD-qPv_AzI2KHk6iWM6u2x3-JI0LGTY9vG4mlBvF0redlJCbAGzo06uy15vSg6vZ5D/s1600/Russian+Federation.png" style="cursor: pointer;margin-right:8px" width="24"/></a>


<a 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/AVvXsEgmM9FrqBAHgIMcxhQ3Vp23AG7u2m7svXWLR3V8k-_1XU5d1MeI0gOKbSwlgEWJ24VMKkEloFlh_m0TjdWdL360_qmfp_zZGZdCDBTCawjAPXr9GPX26AXeK7LYvGKRlkfiaxY-mWj9GAzE/s1600/Brazil.png" style="cursor: pointer;margin-right:8px" width="24"/></a>
<br />
<a 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/AVvXsEiF9iI7CoutZDLE7MWLE-zuAgWXv7NE55mpVqYKH7O2U0yj-xbk-NMIaPn2kYPdPd18fe-Mx9qIu6LYgyzn8LSgaJAQRA_MASW51sBukJJ8nobgMcJyRi47D9qs9wNfLnuA5QJa0KakIVO0/s1600/Japan.png" style="cursor: pointer;margin-right:8px" width="24"/></a>


<a 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/AVvXsEhMQNoSATr1IfcQWfGx2a1fs0EJKuc2IqZXH6HWMBo-vyzMixxhbHI84KxAmsHvcT4nEcI3ldosEwSpaOTNC_CVsJ6sMwnAW1A4l4DwhSH5Fk7WP9H4gdDrnKDC8lkdH9ZNt6ubFfC-BEKb/s1600/South+Korea.png" style="cursor: pointer;margin-right:8px" width="24"/></a>


<a 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/AVvXsEiwreZZ3g4ej8YeXSjYiBKK4lE0DUA-ZZHhyphenhyphenM8GecOH3yAkTfsnDfUfa5C_bUggxl2TtGj0Xl97rj5n4ovHtKItqLLY2KXB-T9NRQ2bSdaDC7IwnknpEWgbkecQWNzwSVh2xYAdIe8P0L-n/s1600/Saudi+Arabia.png" style="cursor: pointer;margin-right:8px" width="24"/></a>


<a 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/AVvXsEglhxBTh5yp61m4vdgLDcrov89PBvmJV91sd4l3qa_8eE22Sf7YhN7Wa45DsTIcEXHNPjzKCaj2FJncfC6GKDPb04ySX57mDraHiuV6w6jtlysrc7JXAEYxPM08f6SJ0w6K5wBjFy0ZxbQQ/s1600/China.png" style="cursor: pointer;margin-right:8px" width="24"/></a>
<p><a href="#" id="example-hide"
onclick="showHide('example');return false;">Hide / </a><a href="http://helplogger.blogspot.com"><font size="1px">Get this widget</font></a></p>
</div>
</div>
[/code]


Bước 3 : Click save và hoàn tất.

Hy vọng là với nôi dung tốt bạn sẽ có thể thu hút nhiều khách viếng thăm blog của bạn đến từ nhiều quốc gia khác nhau.

Chúc các bạn thành công !

Không có nhận xét nào:

Đăng nhận xét