cowboy me, 2.0: jose nazario beauty and the street


translate button



i work with a lot of foreign language websites, most in languages i do not read. to help me with that i often use google translate. but, i got sick of copying and pasting URLs or text, so i built this translate button for firefox.

it works like this: when you're on a page and you want to translate it, surf to the "translate" bookmark (i've located mine in the bookmark toolbar folder in ffox). poof, automagically translated into english. the magic is that the bookmark is javascript that will construct the proper URL for your current page as a target of google translate, and then surf you there. voila.

make a "translate" bookmark and make this the "location" in its properties. now you, too, can have a translate button.
javascript:var h = escape(location.href); 
           newurl = 'http://translate.google.com/translate?u=' + h + '&hl=en&ie=UTF-8&sl=*&tl=en';
           document.write(newurl);
           window.location = newurl;
paste that code in. simple as that. if you need to change the target language you can change "tl=en" to another laguage (e.g. "es" or "fr"). the source language is automatically determined by google translate (see "sl=*").

|

----

next Monday, Nov 17, 2008 @ 10:27am | previous Friday, Oct 24, 2008 @ 02:05pm | archives

Last modified: Sunday, Oct 26, 2008 @ 06:16pm
Weblog Commenting and Trackback by HaloScan.com

Your Ad Here

copyright © 2002-2014 jose nazario, all rights reserved.