Monday, January 01, 2007

Translate your posts into 14 languages (Updates added)

Dear Friends,

This is my first add-on goody for the year 2007. Hope you will like it. Brainiac came up with a suggestion to add more languages to my Google translate for posts hack. As the number of languages provided by Google is limited, I decided to use the BabelFish code, offered in a language translation widget by Amit Agarwal of Digital Inspiration. I have been using this hack in the "Translate" section of my navigational bar (at the top of the page).

- This code offers 14 languages, to which your readers will be able to translate your posts.
- There is also some translation code that Spanish Bloggers can use to allow their readers to read their blogs in English, French, Russian, German and Italian.
(See comments for credits)

I have modified that code so that you can use it in your post footers and allow your readers to translate individual posts (if they like). To learn how to add some thing to your template's post footers, visit this page.

Update: Added code for English to Trukish courtesy emrex


<a expr:href='"http://66.94.231.168/babelfish/translate_url_content?trurl=" + data:post.url + "&amp;lp=en_nl"' title='Nederlands/Dutch'><img alt='Nederlands/Dutch' height='20' src='http://photos1.blogger.com/blogger/3709/485/400/nl.gif' width='30'/> Nederlands</a> |

<a expr:href='"http://66.94.231.168/babelfish/translate_url_content?trurl=" + data:post.url + "&amp;lp=en_fr"' title='Français/French'><img alt='Français/French' height='20' src='http://photos1.blogger.com/img/43/1633/320/13539949_e76af75976.jpg' width='30'/> Français</a> |

<a expr:href='"http://66.94.231.168/babelfish/translate_url_content?trurl=" + data:post.url + "&amp;lp=en_ru"' title='Русский/Russian'><img alt='Русский/Russian' height='20' src='http://photos1.blogger.com/blogger/3709/485/1600/ru.gif' width='30'/> Русский</a> |

<a expr:href='"http://66.94.231.168/babelfish/translate_url_content?trurl=" + data:post.url + "&amp;lp=en_de"' title='Deutsch/German'><img alt='Deutsch/German' height='20' src='http://photos1.blogger.com/img/43/1633/320/13539933_041ca1eda2.jpg' width='30'/> Deutsch</a> |

<a expr:href='"http://66.94.231.168/babelfish/translate_url_content?trurl=" + data:post.url + "&amp;lp=en_it"' title='Italiano/Italian'><img alt='Italiano/Italian' height='20' src='http://photos1.blogger.com/img/43/1633/320/13539953_0384ccecf9.jpg' width='30'/> Italiano</a> |

<a expr:href='"http://66.94.231.168/babelfish/translate_url_content?trurl=" + data:post.url + "&amp;lp=en_pt"' title='Português/Portuguese'><img alt='Português/Portuguese' height='20' src='http://photos1.blogger.com/img/43/1633/320/13539966_0d09b410b5.jpg' width='30'/> Português</a> |

<a expr:href='"http://66.94.231.168/babelfish/translate_url_content?trurl=" + data:post.url + "&amp;lp=en_es"' title='Español/Spanish'><img alt='Español/Spanish' height='20' src='http://photos1.blogger.com/img/43/1633/320/13539946_2fabed0dbf.jpg' width='30'/>Español</a> |

<a expr:href='"http://translate.google.com/translate?hl=ar&amp;ie=UTF-8&oe=UTF-8&langpair=en|ar&u=" + data:post.url' title='العربية/Arabic'><img alt='العربية/Arabic' border='0' height='20' src='http://www.google.com/images/flags/sa_flag.gif' width='30'/> العربية</a> |

<a expr:href='"http://66.94.231.168/babelfish/translate_url_content?trurl=" + data:post.url + "&amp;lp=en_el"' title='Ελληνικά/Greek'><img alt='Ελληνικά/Greek' height='20' src='http://photos1.blogger.com/blogger/3709/485/1600/el.gif' width='30'/> Ελληνικά</a> |

<a expr:href='"http://66.94.231.168/babelfish/translate_url_content?trurl=" + data:post.url + "&amp;lp=en_ja"' title='日本語/Japanese'><img alt='Japanese' height='20' src='http://photos1.blogger.com/img/43/1633/320/13539955_925e6683c8.jpg' width='30'/> 日本語</a> |

<a expr:href='"http://66.94.231.168/babelfish/translate_url_content?trurl=" + data:post.url + "&amp;lp=en_ko"' title='한국어/Korean'><img alt='Korean' height='20' src='http://photos1.blogger.com/img/43/1633/320/13539958_3c3b482c95.jpg' width='30'/> 한국어</a> |

<a expr:href='"http://66.94.231.168/babelfish/translate_url_content?trurl=" + data:post.url + "&amp;lp=en_zh"' title='汉语简化了/Chinese Simplified'><img alt='Chinese Simplified' height='20' src='http://photos1.blogger.com/img/43/1633/320/14324441_5ca5ce3423.jpg' width='30'/> 汉语简化了</a> |

<a expr:href='"http://66.94.231.168/babelfish/translate_url_content?trurl=" + data:post.url + "&amp;lp=en_zt"' title='中國傳統/Chinese Traditional'><img alt='Chinese Traditional' height='20' src='http://photos1.blogger.com/blogger/3709/485/400/zh_tw.gif' width='30'/> 中國傳統</a>

Update: Added code for English to Trukish
<a expr:href='"http://babel.gts-translation.com/geturl?direction=50&amp;input_url=" + data:post.url' title='Türkçe/Turkish'><img src='[Image not available]' alt='Turkish' height='20' width='30'/>Türkçe</a>



Update: Some translate links for Spanish bloggers (based on a wordpress plugin pointed out by brainiac):


<a expr:href='"http://world.altavista.com/babelfish/trurl_pagecontent?url=" + data:post.url + "&amp;lp=es_en"' title='Spanish to English'><img src='http://bp0.blogger.com/_XGtsagQTuUQ/RZk8DP2JNiI/AAAAAAAAADk/eRxHS5s1f10/s320/english.jpg' alt='Eng' /> English</a>

<a expr:href='"http://www1.worldlingo.com/SH0gfCf2o9dM33sw2faPEI,6sc5M9NFT0/translation?wl_url=" + data:post.url + "&amp;wl_srclang=ES&amp;wl_trglang=fr" title='Spanish to French'><img src='http://bp1.blogger.com/_XGtsagQTuUQ/RZk8Df2JNjI/AAAAAAAAADs/jL1jKBhgKFc/s320/france.gif' />Français</a>

<a expr:href='"http://www1.worldlingo.com/SH0gfCf2o9dM33sw2faPEI,6sc5M9NFT0/translation?wl_url=" + data:post.url + "&amp;wl_srclang=ES&amp;wl_trglang=de"' title='Spanish to German'><img src='http://bp1.blogger.com/_XGtsagQTuUQ/RZk8Df2JNkI/AAAAAAAAAD0/JubAGPyc5d4/s320/germany.gif' />Deutsch</a>

<a expr:href='"http://www1.worldlingo.com/SH0gfCf2o9dM33sw2faPEI,6sc5M9NFT0/translation?wl_url=" + data:post.url + "&amp;wl_srclang=ES&amp;wl_trglang=it"' title='Spanish to Italian'><img src='http://bp3.blogger.com/_XGtsagQTuUQ/RZk8Q_2JNmI/AAAAAAAAAEE/pJodrosGp8I/s320/italy.gif' />Italiano</a>

<a expr:href='"http://www1.worldlingo.com/SH0gfCf2o9dM33sw2faPEI,6sc5M9NFT0/translation?wl_url=" + data:post.url + "&amp;wl_srclang=ES&amp;wl_trglang=ru"' title='Spanish to Russian'><img src='http://bp0.blogger.com/_XGtsagQTuUQ/RZk8RP2JNpI/AAAAAAAAAEc/Tnq_uTX3WhY/s320/russia.gif' />Русский</a>



If you want to display only the flag images, simply delete the text between the img tag and the </a> tag. In case you want to have only the text, remove the img tag completely. As always, don't forget to make a backup of your template before applying this code.

Please drop a line here if you find some bug or if some thing doesn't work. I have not tested out most of the code.

Also, Deniz of imessengr is now offering a modded three-column Thisaway template loaded with popular hacks. Visit his page to learn more and download the template.

9 comments:

emrex said...

thanks.
add pls English to Turkish :)

Brainiac said...

thanks, Babelfish allows to add other languages if blog is not in English. WorldLingo made translations to many languages (did in 2 steps, first your language to English, later to the second language), although in Wordpress I have seen plugin with WorldLingo that works at this moment, rare, the author seems that combines babelfish AltaVista and wordlingo to obtain it WorldLingo Wordpress.

Vivek Sanghi said...

@emrex:
Thanks for the English to Turkish code. I have added it :)

@brainiac:
Thanks for pointing me to the wordpress plugin. I have used the link in there and posted it for Blogger users. I have no clue how the plugin creator was able to get the links. I tired other lang pairs using these links and it gave error. So I guess we will have to work with whatever we can find of WorldLingo on the net.

Skanky Jane said...

Vivek,

I don't know why I cannot get my blog to accept this nice hack of yours.

I have added things to my post footer successfully before - including your former translation hack (albeit to a different blog than the one I am now wrestling with).

When I add your code and click "save' Blogger comes up with the "not parsed properly" comment and says that "the entity 'oe' must have the ';' delimiter".

Personally I think that is Blogger speak for "Something is wrong but I don't know what it is". I have noticed this before - that Blogger sometimes finds an error but gives the wrong cause for it.

Has anyone else had probs with adding this to thier blog? Are there any known issues associated with it that might give a clue to my problem?

Thanks,
SJ xx

Rupesh said...

use translate_p to remove the translation bar.

Rupesh said...

Check out the new translation tool

Fajar Nugraha said...

hi there...this is something that I am looking for! great!

question, could I put this to my sidebar? or does it only in the footer?
thanks.

dennyhalim.com said...

tried to put this into my blog.

i dont know why those babelfish doesnt work for me.

so, i change some stuffs and i made myself a widget with 18 languages.

so now, i can also use this on my website other than blogger.

also, i removed the top frame on translated pages.

see in my blog:
http://it.dennyhalim.com

Angel said...

Hello could you please tell me how to alter this code so i can paste in in Page Element's? Currently it does not work(the link wont work at all). ANd when I tried to just drop the code in my html i got an error "parsed something". Right now I just used the google translate into the page elements and it works fine but of all 8 it doesnt have the laguages that I speak

Other posts @ Stubborn Fanatic

Click here to view all my posts.

Creative Commons License
This work is licensed under a
Creative Commons Attribution-ShareAlike 2.5 License.

However, prior permission is required before you can display any content from this blog on your site. The author reserves the right to demand removal of such content at any time for any reason. (Not applicable for back-linking)
Note: The author is not responsible for any loss of data or damages to your homepage as a result of using the hacks suggested here. Please observe all necessary precautions while modifying template code.

© 2006 Vivek Sanghi a.k.a Stubborn-Fanatic