a chrome plugin to translate, no advertisement
- select a piece of text with mouse, then right click, select an option from the menu
- pop up a translation block over the selection , then fade out in 5 seconds
- support PDF reading on chrome
- shortcut to trigger translation
- Ctrl + Shift + Y, translate English to Chinese
- Ctrl + Shift + U, translate Chinese to English
- Ctrl + Shift + H, show english explaination
- Python3
- Redis
- Flask
please see Reference
-
install redis, on Ubuntu
sudo apt install redis
-
download english thesaurus, and cache thesaurus to redis
git clone git@github.com:zaibacu/thesaurus.git thesaurus # upload to reids python3 upload_thesaurus_to_redis.py
-
add environment variable, change your baidu api information
vim ~/.bashrc or ~/.zshrc
export BAIDU_FANYI_APPID="xxxx" export BAIDU_FANYI_PASSWD="xxxx" export BAIDU_FANYI_SALT="xxxx"
see more baidu fanyi api documentation
-
set up flask
pip3 install pyttsx3 pip3 install flask pip3 install flask-cores pip3 install inflect cd flask-background flask --app chrome-backend.py run