Pages

Tuesday, September 6, 2011

One-Click translations with Google translate

Here's a quick way to create a bookmark 'button' on your toolbar that allows you a One-Click translation of pages into English.
Right Click on the bookmarks toolbar and select "New Bookmark", then in the 'Location' field enter the following string (you can copy it off and paste it...)

javascript:var%20t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var%20e=(document.charset||document.characterSet);if(t!=''){location.href='http://translate.google.com/?text='+t+'&hl=en&langpair=auto|en&tbb=1&ie='+e;}else{location.href='http://translate.google.com/translate?u='+encodeURIComponent(location.href)+'&hl=en&langpair=auto|en&tbb=1&ie='+e;};

Done!