Tuesday, September 05, 2006

Translate blogs using Google (blogger beta)

I have been able to locate the URLs used for submitting a page to the Google translate tool. I have incorporated them into my template such that the links appear under every post and readers can use it to translate a post into another language. Currently Google translate supports few languages and I will update my post footer when they add more languages.

You can view and copy the code for using google translate (as in my post footers) from here. (Placed it in an external link coz people started telling me that some thing is broken in my blog and code is spilling out!)

The image based goolge translate code contains direct links to the images of flags of the respective countries. You may use the same links or modify and upload the images to your server or image host and replace [image source] with the direct URL. Or use text links like me. The code for the text links is also located in the link. Incase of any problems, feel free to drop a line here. adios!

24 comments:

Unknown said...

Thanks for viewing my Blog. Well... I must say my blog is nothing when compared to ura which gives a spectrum of tech stuff. NEway keep coming back.. .for my new hacks.. bye

Anonymous said...

Hi, I got to your blog through Ramani's blog. I was reading your very blog translated to portuguese by google (portuguese is my birth language), and it doesn't make much sense. As a matter of fact, the sentences seem to be writen by a 5 year old. I think we're gonna have to wait for more advanced artificial intelligence. Please don't get me wrong, this comment doesn't concern to the quality of your blog, but to google's translator skills.

Vivek Sanghi said...

@Noronha
I will agree that the translate tool needs to evolve to give better output results. Same is the issue with babel fish of altavista because they appear to be using the same engine.

Anonymous said...

doesn't work in my blog, http://technonews2day.blogspot.com

maybe because it is a non beta blogger, i don't know...is there a work around to this? thanks

Vivek Sanghi said...

@chllout_lev

My code work only with blogger beta. You might want to consider switching over. However, you can implement it in classic blogger using this code. If you have any problems, use the code I provided and make the following changes in it:

1. Delete expr: before href.

2. delete some of the single (') and double (") quotation marks. eg:
<a href='"http://translate.google.com/translate?hl=
pt&amp;ie=UTF-8&amp;oe=
UTF-8&amp;langpair=en|pt&amp;
u=<$BlogItemPermalinkUrl$> target='_blank' title='Traducao por Google'>Portugues</a>

Let me know if it works. To find the exact location of post footer code in your classic template, please make use of the blogger help group.

Vivek Sanghi said...

@$!ckbh0y

-- but don't want it at the bottom of every post.

The code can be modified to make it a page element.

-- I wanted the "more>" link inline with the language flags,

If thats for the posts footer, I am afraid, I was unable to get them inline due to some formatting issues. If its for the sidebar, place the "img" tag before the href tag and it should be done.

-- want to create a page element with this in, but the code gets altered after saving the page element and the links don't work - you get linked direct to beta.blogger.com instead of the translate site.

I checked your blog and saw that the translate links are working fine. I was able to view your pafe in other languages.

-- I can't impliment the AdSense for Search box at the page bottom

I guess you have added it as a page element at the bottom of the page. Try placing that code within "center" "/center" tags. It might work.

-- I've a support query open for this with AdSense support.

Because this is a formatting issue with your blog, I recommend you contact blogger support or seek help on blogger help group. If you ahve any more questions, send a an E-mail and I will be on it.

和春技術學院圖書館 said...

how can I translate chinese(zh-tw)
into english?

Vivek Sanghi said...

Hello Friend. Here is the code to convert chinese to English. I could not find zh-tw on Google but simplified chinese seems to work for your blog.

<a expr:href='"http://translate.google.com/translate?hl=en&amp;ie=
UTF-8&amp;oe=
UTF-8&amp;langpair=zh-CN|en&amp;u=" + data:post.url' target='_blank' title='Translate with Google'>English</a>

Here is the output

Skanky Jane said...

Thank you! I love this! It is great that people do not have to go away to have the posts translated - excellent way to increase readership - smart move! Thanks again.

SJ xx

Vivek Sanghi said...

Hello Skanky Jane. Thanks for dropping by and using my hacks. Stay tuned for more such hacks.

Unknown said...

Please, how can I translate portuguese into english?
Thanks !

Vivek Sanghi said...

@CellyOneill

You can use this code (please copy-paste) in your post footers to allow your readers to view Portuguese posts in English:

<a expr:href='"http://translate.google.com/translate?hl=pt
&amp;ie=UTF-8&amp;oe=UTF-8&amp;langpair=pt|en&amp;
u=" + data:post.url' title="English" target='_blank'>English</a>

Let me know if you face any issues with this.

manetsute said...

tHanK u veRy mUch fOr tHis aMaziNg haCk!! aM uSing it. aLthouGh can iT aLso iNcLude fiLipinO? iT wouLd be reaLLy sweeT. uR bRiLLiant!

Vivek Sanghi said...

@ vï†æ
Thanks for the kind words. I checked major translation service providers like Google and BabelFish (Altavista) and they do not have machine based automatic translation from Filipino to English and vice-versa. If you can find a site that provides such a service, please let me know and I will try to find out the code for it. Thanks for stopping by! Cheers

Unknown said...

Thanks so much for the help !
But doesn't work in my blog...
please help me one more time !
Hugs from Brazil !

Vivek Sanghi said...

Hello CellyOneill. Send me your template HTML (expanded widgets) via e-mail text attachment with your blogger name and "Google translate" as subject and I will incorporate it in there for you. Cheers!

Brainiac said...

About Translation Hack: Vivek, Google only tranlates for example, Spanish (my language) to English, but WorldLingo translates to many more languages, for Blogger already exists Hack, you can update it for Blogger Beta? Please

Translation WorldLingo Blogger

Vivek Sanghi said...

Hello Brainiac. From the link that you have given, at the end of that post, the author has written that worldlingo serivce is no longer free. I have checked the code given there and it no longer works. Hence Worldlingo cannot be used now unless we pay for it.

However, based on your request for more languages, I am using yahoo babelfish and Google together to present the ultimate translation solution with 13 languages. Stay tuned for the hack.

Lovely said...

Thanks for this nice tweak, it worked on my blog (http://visitformoney.blogspot.com). Please check whether it looks nice or do i need to modify more ???

Best Regards,
Eliena Andrews
http://visitformoney.blogspot.com

N A Z M I E S K I said...

hi vivek,
thanks for the translate tools blog.u really rock it....keep up the gud work dude.....

Charles Vaz said...

Awesome,
Good points and Thanks for a good useful article, which foced me to look around and I found a better technique.
In reference to translations, there is a good underlying point about many Languages like Hindi - still needing direct online web based translation for a wider web audience.

Check out my tech blog. I have a nice translation technique which works in IE (Win XP). Opera, Mozilla-Firefox and on Knoppix(LINUX) and PCLINUX OS(LINUX)too. Also, check out my radio blog (if you scroll down on my blog) and play my favourite music from my blog.

Have fun & Take Care & More Articles Please,

Charles

Vivek Sanghi said...

Hello Charles. Thanks for stopping by. I just went through your blog and like topics/the radio blog music player in it.

I won't be able to promise more hacks, at least for another seven months, until my MBA course finishes.

I am using my time to grasp as much as I can in finance which is a far cry from coding and I.T. My schedules have been very busy due to the nature of my course and hence no time to even reply to the comments and questions that my readers ask.

I hope all of them understand my side of the story as well.

Regards
Vivek

reog said...

hi vivek,
thanks for your code. The code run great in my blog http://inspirationalfoodculinary.blogspot.com
and i want to ask you,can I create sub labels like wordpress did with sub pages

thanks

Rupesh said...

Check out the new translation tool

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