i thought i'd give back to the community that has helped me out so much. i hacked together these javascript utilities to make translating japanese sites quicker. simply copy the scripts into your bookmarks toolbar for easy, single-click access. sorry about the page width; the -url- tag wouldn't accept/link these scripts since they don't start with the "http" keyword. translate current page or selection via google Code: javascript:var%20tx_userSelection;if(window.getSelection){tx_userSelection=window.getSelection();}else%20if(document.selection){tx_userSelection=document.selection.createRange();}var%20tx_selectedText=tx_userSelection;if(tx_userSelection.text)tx_selectedText=tx_userSelection.text;function%20tx_display(txt){var%20popup=window.open('http://translate.google.com/translate_t?text='+encodeURIComponent(txt)+'&langpair=ja|en&hl=en&ie=UTF-8&sl=ja&tl=en','tx-g','width=780,height=565,scrollbars=yes,toolbar=no,menubar=no,location=yes,directories=no');if(window.focus){popup.focus()}};if(tx_selectedText!=''){tx_display(tx_selectedText)}else{window.location.href='http://translate.google.com/translate?u='+encodeURIComponent(window.location.href)+'&sl=ja&tl=en&hl=en&ie=UTF-8'} translate current page or selection via babelfish Code: javascript:var%20tx_userSelection;if(window.getSelection){tx_userSelection=window.getSelection();}else%20if(document.selection){tx_userSelection=document.selection.createRange();}var%20tx_selectedText=tx_userSelection;if(tx_userSelection.text)tx_selectedText=tx_userSelection.text;function%20tx_display(txt){var%20popup=window.open('http://babelfish.yahoo.com/translate_txt?trtext='+encodeURIComponent(txt)+'&ei=UTF-8&doit=done&fr=bf-res&intl=1&tt=urltext&lp=ja_en','tx-b','width=485,height=565,scrollbars=yes,toolbar=no,menubar=no,location=yes,directories=no');if(window.focus){popup.focus()}};if(tx_selectedText!=''){tx_display(tx_selectedText)}else{window.location.href='http://us.lrd.yahoo.com/_ylt=A0LEUFlN1plI2GsAIVeu7s4F/SIG=11sl0ed31/EXP=1218127821/*-http%3A//babelfish.yahoo.com/translate_url?trurl='+encodeURIComponent(window.location.href)+'&ei=UTF-8&doit=done&fr=bf-home&intl=1&tt=url&lp=ja_en'} let me know if they don't work for you guys — they've only been tested on safari 3 & firefox 3. happy toy hunting!
Re: translation tools That is just awesome. They all seem to work fine in Firefox 3. Edit: Whoops...almost. The selected pop-up script has a weird bit of behavior in Firefox. The original page window/tab is replaced by an [object Window] page. Still, very cool. Thanks. -- jJ
Re: translation tools thanks for the feedback! i'm glad it's useful to some of you. i cleaned up the code a bit and also fixed the third option to be more standards compliant. it now behaves properly in firefox. please let me know of any other bugs and/or modifications you would like to see.
Re: translation tools i'd love a modification that would speak to yahoo japan sellers and convince them to sell to me at a much lower cost
Re: translation tools by request, a fourth option has been added to translate selected text via google as well as babelfish. now you can display both google and babelfish windows side by side for better combined translation efforts. please update your previously bookmarked versions with these latest changes. enjoy, and thanks for the input!
Re: translation tools Even easier: Go to http://translate.google.com/translate_tools?hl=en There you will find a link that you can add to your link bar. When you click it, it will translate the current page or , if something is selected, the selection.
Re: translation tools i wish i had known about that earlier. it certainly would have saved me all the effort of coding up my own! i wonder why it's not linked from their main language page? now i'll have to see if my hack job is anywhere near what they've done for themselves. i should combine my page/selection scripts into one as well. thanks for posting that link! at least the babelfish script is still useful. i've noticed that it really requires both translations to make sense of many pages. does anyone know if these types of bookmarklet scripts work on the iphone?
Re: translation tools new and improved! now with less options! the two separate scripts for each translator have been combined into one. if no text is selected on the page, it translates the entire page. if there is a selection, only that portion is translated and displayed in a popup window. so even though google provides a similar bookmarklet, this one is a little more convenient for multi-translation-comparison. thanks to coasterbear for the inspiration!