To create a bookmarklet for a translation engine, follow these steps: Go to your translation engine site. Set the appropriate options such as source and target languages. Enter a dummy Web address to be translated, e.g. "DUMMY_ADDRESS" Run the translation Copy the Web address of the translation page to a text editor. Some translation engine uses frames; in that case, right click (ctrl+click on Mac OS X) the frame of the translated text and choose This Frame | Show Only This Frame. In the text editor, find the dummy address. If the dummy address is somewhere in the middle, replace it with "+escape(location.href)+". Append "; to the end of the line. Add javascript:location.href=" to the begining of the line. For example: http://translate.google.com/translate?u=DUMMY_ADDRESS&langpair=en%7Cfr becomes javascript:location.href="http://translate.google.com/translate?u="+escape(location.href)+"&langpair=en%7Cfr"; If the dummy address is at the end, replace it with "+escape(location.href); and add javascript:location.href=" to the begining of the line. For example: http://translate.google.com/translate?langpair=en%7Cfr&u=DUMMY_ADDRESS becomes javascript:location.href="http://translate.google.com/translate?langpair=en%7Cfr&u="+escape(location.href); If the dummy address is nowhere to be found, then the settings are passed "in the background" and you cannot create a bookmarklet for it. Create a bookmark and set its location to the text in your text editor.
2013年2月20日 星期三
How to Create a Bookmarklet for a Translation Engine
Labels:
Tips
嗨,大家好!我是一位資訊人、畫畫人、科技人和行銷人。定位自己為網路觀察家,永遠保持好奇心與熱情,學習跨領域新事物,希望最終能成為一個全方位的人。喜歡探索新技術和創意,並將其應用於工作和生活中。也喜歡畫畫、旅行、閱讀和寫作。希望我的部落格可以為您帶來啟發和樂趣,並與您分享我的經驗和見解。謝謝您的訪問,期待與您交流!
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言