Translate Your Homepage With ONE CLICK
Wednesday, January 6, 2010 11:19:35 AM
Visitors to our homepages only hang around if our pages work well! I wanted a one-click translation of my homepage http://www.ring-carlsen.dk for this very reason! Beside that I wanted it to work with Opera Mini and in My Opera! First I thought I needed a Bookmarklet. My start point was a Bookmarklet from Yeswaps page:
javascript:location=%27http://translate.google.com/translate?u=%27%20+%20encodeURIComponent%28location%29;
My friend Vectronic helped me to get to this Bookmarklet:
javascript:location=%27http://translate.google.com/translate?u=www.ring-carlsen.dk%27
It works fine but demands the user to select from and to language plus selecting translate. I needed to pre set the languages and found a page about that. Google use following tags:
hl: Translate page language
sl: Source page language
tl: Translate TO language
I added the codes and arrived to this Bookmarklet:
javascript:location=%27http://translate.google.com/translate?hl=en&sl=da&tl=en&u=www.ring-carlsen.dk%27
This works super and provides the one click translation :-). You can try and copy it to your browser. BUT it does not work in My Opera! So back in the think box! Then it dawned to me that we had removed the active script parts! So no reason to use the javascript call! That resulted in this "simple" link:
http://translate.google.com/translate?hl=en&sl=da&tl=en&u=http://www.ring-carlsen.dk/
This Link sets the 3 languages and the source page. It works everywhere, as it is "just" a Link. You can make say 5 Links for 5 different languages if you like.
Corrected for problem with IE: http://translate.google.com/translate?hl=en&ie=UTF-8&sl=da&tl=en&u=http://www.ring-carlsen.dk/&prev=_m&twu=1
GUIDE TO MAKE TRANSLATE LINK
http://translate.google.com/translate?hl=X1&ie=UTF-8&sl=X2&tl=X3&u=http://X4/&prev=_m&twu=1
Insert X1 -> X4 in the link above
X1: Translate page language (I chouse en for English)
X2: Source page language (I chouse da for Danish)
X3: Translate TO language (I chouse en for English)
X4: The html page or domain you want to translate
Codes for other languages you can see here http://sites.google.com/site/tomihasa/google-language-codes
If you use frames you need to open the Link into a new page (target=”_blank”)!
After all this rumbling I realized that the Link also can be created using http://translate.google.com , inserting all the settings, hit translate and then bookmark the page. BUT Translate page language is not easy to set!
Well sometimes you need to cross the desert to get sand :-s
Thomas aka Samoht1








selurus # Wednesday, January 6, 2010 7:52:40 PM
Thomas Oneclicksamoht1 # Wednesday, January 6, 2010 8:00:07 PM