Sep 2, 2008 in

Google translation Widget for Blogger - Translate any website in English to 25 other languages

Now with Google translation widget you can translate english to 25 other languages like Arabic , Bulgarian , Chinese ( simplified and traditional) , Croatian , Czech , danish , Dutch , Finnish , French , German , Greek , Hindi , Italian , Japanese , Korean ,Norwegian , Polish , Portuguese ,Romanian , Russian , Spanish and Swedish. I hope no one might have seen such a huge list anywhere. This Widget is powered by Google. This Google translation Widget helps your readers to read the article in their own regional language.

You can add this widget either in sidebars or below each post.

Code for Google Translation Widget :



<div style="padding:10px 10px 10px 10px;text-align:center;">

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Car&hl=en&ie=UTF8'); return false;" title="Translate English to Arabic"><img border="0" style="cursor:pointer; cursor:hand;" alt="Translate English to Arabic" width="24" src="http://i263.photobucket.com/albums/ii150/mohamedrias/Arabic_Flag.png" height="18" title="Translate English to Arabic"/></a>



<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cbg&hl=en&ie=UTF8'); return false;" title="Translate English to Bulgarian"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Arabic" src="http://i166.photobucket.com/albums/u106/language_forum/Languages/Bulgarian_Flag.png" height="18" title="Translate to Bulgarian"/></a>


<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Czh-CN&hl=en&ie=UTF8'); return false;" title="Translate to Chinese (Simplified) BETA"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Google-Translate-Chinese (Simplified) BETA" src="http://i263.photobucket.com/albums/ii150/mohamedrias/_chinese_s.png" height="18" title="Translate to Chinese (Simplified) BETA"/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Czh-TW&hl=en&ie=UTF8'); return false;" title="Translate English to Traditional Chinese"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Arabic" src="http://i166.photobucket.com/albums/u106/language_forum/Languages/Mandarin_Flag.png" height="18" title="Translate to traditional Chinese"/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Chr&hl=en&ie=UTF8'); return false;" title="Translate English to Croatian"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Croatian" src="http://i166.photobucket.com/albums/u106/language_forum/Languages/Croatian_Flag.png" height="18" title="Translate to Croatian"/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Ccs&hl=en&ie=UTF8'); return false;" title="Translate English to Czech"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Czech" src="http://i166.photobucket.com/albums/u106/language_forum/Languages/Czech_Flag.png" height="18" title="Translate to Czech"/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cda&hl=en&ie=UTF8'); return false;" title="Translate English to Danish"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to danish" src="http://i166.photobucket.com/albums/u106/language_forum/Languages/Danish_Flag.png" height="18" title="Translate to Danish"/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cnl&hl=en&ie=UTF8'); return false;" title="Translate English to Dutch"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Dutch" src="http://i40.photobucket.com/albums/e208/winglord01/nederlands.gif" height="18" title="Translate to Dutch"/></a>


<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cfi&hl=en&ie=UTF8'); return false;" title="Translate English to Finnish"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Finnish" src="http://i166.photobucket.com/albums/u106/language_forum/Languages/Finnish_Flag.png" height="18" title="Translate to Finnish"/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cfr&hl=en&ie=UTF8'); return false;" title="Translate English to French"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to French" src="http://i18.photobucket.com/albums/b120/pdhinderlie/Web%20Stuff/Flags/flag_fr.gif" height="18" title="Translate to French"/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cde&hl=en&ie=UTF8'); return false;" title="Translate English to German"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to German" src="http://i263.photobucket.com/albums/ii150/mohamedrias/_german_s.png" height="18" title="Translate English to German"/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cel&hl=en&ie=UTF8'); return false;" title="Translate English to Greek"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Greek" src="http://i18.photobucket.com/albums/b120/pdhinderlie/Web%20Stuff/Flags/flag_gr.gif" height="18" title="Translate to Greek"/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Chi&hl=en&ie=UTF8'); return false;" title="Translate English to Hindi"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Hindi" src="http://i323.photobucket.com/albums/nn467/techbookmark/hindi.png" height="18" title="Translate to Hindi"/></a>


<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cit&hl=en&ie=UTF8'); return false;" title="Google-Translate-English to Italian"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt=" Translate English to Italian" src="http://i263.photobucket.com/albums/ii150/mohamedrias/_italian_s.png" height="18" title=" Translate English to Italian"/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cja&hl=en&ie=UTF8'); return false;" title="Google-Translate-English to Japanese BETA"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Google-Translate-English to Japanese BETA" src="http://i187.photobucket.com/albums/x307/Mafishioso/_japanese_s.png" height="18" title="Translate English to Japanese BETA"/></a>


<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cko&hl=en&ie=UTF8'); return false;" title=" Translate English to Korean BETA"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Korean BETA" src="http://i263.photobucket.com/albums/ii150/mohamedrias/_korean_s.png" height="18" title="Translate English to Korean BETA"/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cno&hl=en&ie=UTF8'); return false;" title="Translate English to Norwegian"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Norwegian" src="http://i536.photobucket.com/albums/ff328/pmhrid/norway_flag.png" height="18" title="Translate to Norwegian"/></a>
<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cpl&hl=en&ie=UTF8'); return false;" title="Translate English to Polish"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Polish" src="http://i166.photobucket.com/albums/u106/language_forum/Languages/Polish_Flag.png" height="18" title="Translate to Polish"/></a>
<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cpt&hl=en&ie=UTF8'); return false;" title="Translate English to Portuguese"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Portuguese" src="http://i18.photobucket.com/albums/b120/pdhinderlie/Web%20Stuff/Flags/flag_pt.gif" height="18" title="Translate to Portuguese"/></a>
<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cro&hl=en&ie=UTF8'); return false;" title="Translate English to Romanian"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Romanian" src="http://i166.photobucket.com/albums/u106/language_forum/Languages/Romansh_Flag.png" height="18" title="Translate to Romanian"/></a>
<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cru&hl=en&ie=UTF8'); return false;" title="Translate English to Russian"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Russian" src="http://i166.photobucket.com/albums/u106/language_forum/Languages/Russian_Flag.png" height="18" title="Translate to Russian"/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Cru&hl=en&ie=UTF8'); return false;" title=" Translate English to Russian BETA "><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Russian BETA " src="http://i263.photobucket.com/albums/ii150/mohamedrias/_russian_s.png" height="18" title=" Translate English to Russian BETA "/></a>

<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Ces&hl=en&ie=UTF8'); return false;" title="Translate English to Spanish"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Spanish" src="http://i166.photobucket.com/albums/u106/language_forum/Languages/Spanish_Flag.png" height="18" title="Translate English to Spanish"/></a>


<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Csv&hl=en&ie=UTF8'); return false;" title="Translate English to Swedish"><img border="0" style="cursor:pointer; cursor:hand;" width="24" alt="Translate English to Swedish" src="http://i166.photobucket.com/albums/u106/language_forum/Languages/Swedish_Flag.png" height="18" title="Translate to Swedish"/></a>
<div style="display:none;">
<small><a href="http://www.techieblogger.com" target="_blank">Grab this widget</a></small></div>
</div>


Customizing the code to your language : In this widget i wrote coding to translate WebPage in English to other languages. If you want to use this widget to translate your regional language to other foreign Language , then you need to customize the script.

I am going to explain How to change text from Arabic to English. Do the same to translate from one particular language to other languages.



<a target="_blank" rel="nofollow" onclick="window.open('http://www.google.com/translate_p?u='+encodeURIComponent(location.href)+'&langpair=en%7Car&hl=en&ie=UTF8'); return false;" title="Translate English to Arabic"><img border="0" style="cursor:pointer; cursor:hand;" alt="Translate English to Arabic" width="24" src="http://i263.photobucket.com/albums/ii150/mohamedrias/Arabic_Flag.png" height="18" title="Translate English to Arabic"/></a>

In the above example , the text in red is used to open links in new page.

text in green is your language code ( web pages language ).

Arabic = ar ; Bulgarian = bg ; Chinese Simplified = zh-CN ; traditional Chinese = zh-TW ; Croatian = hr ; Czech = cs ; Danish = da ; Dutch = nl ; Finnish = fi ; French = fr ; german = de ;
Greek = el ; hindi = hi ; Italian = it ; Japanese beta = ja ; korean = ko ; Norwegian = no ; Polish = pl ; Portuguese = pt ; Romanian = ro ; Russian = ru ; Spanish = es ; and lastly swedish = sv ;.


please replace the text in green to your language. My blog is in English so I have kept " en " there.

text in Red :

Text in red is the language code to which you are going to translate. Please change the code in red to your destination language.

Text in violet :

It's the title tag , when we hover over the images the title tag will shown.

I hope i have explained everything in the code.


How to Add this to Sidebar



If you want to add this widget in your sidebar please login to your blogger account. Navigate to Layout section of your Blog. Add a HTML / Javascript page element and paste the code above there.

That's it you have successfully added Google translation Widget to your sidebar.


Adding Google translation widget below Each post in Blogger



To add Google translation Widget below each in blogger . Go to EDIT HTML page. There put a check in Expand Widgets box. now search for this code <p><data:post.body/></p> now add the Google translation Code below that line.

Now you can see a beautiful Google translation Widget in your blog below each post.


Check Out This Popular Posts

2 Responses So far
gravatar
Nirmal Balaji
on March 2, 2009 at 3:34 PM  

Thanks for updating this great one .
Best Regards :
http://rogerfedererthechamp.blogspot.com

gravatar
staff admin
on May 18, 2009 at 6:16 PM  

Wow, I'ts not like translator widget I've found in widgetbox. Your code directly works! Thanks :)
http://yarozaq.blogspot.com

Post a Comment

Custom Search
Web Analytics