SimpleTranslator v0.3

By silver_java Last update Sep 3, 2010 — Installed 1,212 times.

Script Summary: It's a little translator(English->Chinese), with double clicking or selecting the word, you can get the translated result from Google Translate, meanwhile, you don't have to leave the current page you're browsing. I'm sure this script is faster than some GUI applications :)



Usage

  • With double clicking / selecting words or sentences on the web page, SimpleTranslator will translate the target and give you result.
  • Using alt+q can turn ON/OFF translator. Current default STATE is OFF, please press alt+q to turn it ON when you need it.
  • If you're familiar with javascript, you can modify the code directly to fit your needs, I've added comments as many as I can in the source code to help you understand what it's doing.
  • By pressing alt+i, you can input the word you want to look up freely.

NOTE


Currently, only supports English to Chinese, but you can modify the code to let it fit you needs.

Changes


2009-11-29
Rewrite the code since Google's translated format has been changed.

2009-9-6

    JCN0003
  • IMPORTANT Set default STATE to OFF, you can press alt+q to turn on translator when you need it. The reason why I do this is because SimpleTranslator maybe inconvenient when you're gonna copy something from the web page.
  • By pressing alt+i, you can look up words by your inputs.

2009-9-2

    JCN0002
  • Refactored code
  • Added a new feature to turn ON/OFF translator (by pressing alt+q)
  • Updated display area css style.

2009-9-1

    JCN0001
  • Fixed NS_ERROR_ILLEGAL_VALUE issue.
  • Updated getting window selection part code to make it easier.
  • Refactored display area code to make reusable.

TODOs

  • It's inconvenient when you want to copy a piece of text. (This only means pure english sentences) A possible way to solve this is to give a way to turn off/on the translator (For example, Alt+x will switch the translator's state).DONE
  • Add a test to see whether the selected area is all non-english words.DONE
  • Add css to make the style of display area consistent, because current implementation depends on the css setting of host page.DONE
  • Add looking up word by user inputDONE