Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

bookmarklet

Name: Anonymous 2008-03-26 16:58

well i've wanted to make a bookmarklet for translating webpages and if finally finished it. nice thing about it, you can translate multiple languages with this one bookmarklet.

heres the code blast, you can put it into the bookmark location when making a new bookmark:::::::::::::::::::::::::

javascript:var l="";var lang=prompt(".:Google Translate to English:."+'\n'+"Use Abbreviations below to set language"+'\n'+'\n'+"AR Arabic"+'\n'+"CH Chinese"+'\n'+"DU Dutch"+'\n'+"FR Fench"+'\n'+"GR German"+'\n'+"GK Greek"+'\n'+"IT Italian"+'\n'+"JA Japanese"+'\n'+"KO Korean"+'\n'+"PO Portuguese"+'\n'+"RU Russian"+'\n'+"SP Spanish",'');var ulang=lang.toUpperCase();switch (ulang){case "AR":l="&hl=en&langpair=ar|en&tbb=1&ie=";break;case "CH":l="&hl=en&langpair=zh|en&tbb=1&ie=";break;case "DU":l="&hl=en&langpair=nl|en&tbb=1&ie=";break;case "FR":l="&hl=en&langpair=fr|en&tbb=1&ie=";break;case "GR":l="&hl=en&langpair=de|en&tbb=1&ie=";break;case "GK":l="&hl=en&langpair=el|en&tbb=1&ie=";break;case "IT":l="&hl=en&langpair=it|en&tbb=1&ie=";break;case "JA":l="&hl=en&langpair=ja|en&tbb=1&ie=";break;case "KO":l="&hl=en&langpair=ko|en&tbb=1&ie=";break;case "PO":l="&hl=en&langpair=pt|en&tbb=1&ie=";break;case "RU":l="&hl=en&langpair=ru|en&tbb=1&ie=";break;case "SP":l="&hl=en&langpair=es|en&tbb=1&ie=";break;default:alert('Translate Error');};var t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection &&document.selection.createRange&&document.selection.createRange().text));var e=(document.charset||document.characterSet);if(t!=''){location.href='http://translate.google.com/translate_t?text='+t+l+e;}else{location.href='http://translate.google.com/translate?u='+escape(location.href)+l+e;};

:::::::::::::::::::::::::::

and ofcourse it needs to be as 1 continues line of code

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List