An Alfred 5 workflow to translate text using OpenAI, DeepL, Google, Bing, Baidu and Youdao. This workflow also supports Universal Actions.
- Alfred PowerPack
- Python3 (system shipped Python3 not recommended, use other sources like, Homebrew or pyenv installed Python3)
- Google translation is free and unlimited and requires no dependency, but may fail in mainland China.
- OpenAI Translation requires OpenAI API
- DeepL Translation requires DeepL API
- Other translation services (optional) require translators library, if you ever need them, install via:
# PYPI
pip install --upgrade translators
# Conda
conda install -c conda-forge translators
# Source
git clone https://github.com/UlionTse/translators.git
cd translators
python setup.py install
- Set up: target language, method of translation and your APIs. (Please check supported source language code from DeepL API docs and Translators library)
- Type anything after keyword
trans
to translate, it will auto-detect the source language. - Then select any result and
⏎
to copy text to your clipboard ⌘ + ⏎
to view large text (useful if results are long)- For universal control, simply select any text and search for
translate
. - Set up basic language configs (base target and keyword) in case you want to add a second translation target, which might be beneficial for bidirectional translation or multilingual support.
- Open-source project UlionTse/translators, a library which aims to bring free, multiple, enjoyable translation to individuals and students in Python.
- Inspired by a discussion in a great macapp tisfeng/easydict
- py-googletrans
Any suggestions are welcome!
Please consider buying me a coffee if you find this workflow helpful