English | 中文
Platform | supported | description |
---|---|---|
Aliyun Translation | ✅ | The first 1 million characters per month are free for the General Edition of machine translation. Charges of 50 RMB per million characters will apply for any exceeding usage.document,price |
OpenAI | ✅ | OpenAI API Key apply |
MicroSoft Azure Translation | ❌ | Translation of up to 2 million words per month is free. If you exceed 2 million words monthly, charges will apply at a rate of $10 per million words. For further details, please consult the official pricing documentation.。document |
Baidu Translation | ✅ | Provide standard version, advanced version, exclusive version of the service, complete identity authentication, enjoy a maximum of 2 million free characters per month。document |
Volcano translation | ✅ | Volcano translation is free of charge for the first 2 million characters per month, and the excess will be charged according to 49 RMB per million characters.。document |
You need Node.js 18+ and Alfred 4 or later with the paid Powerpack upgrade.
npm install -g @mohaiyo/translate-hub
pnpm install -g @mohaiyo/translate-hub
Open Alfred and enter trc use [openai]
. you can see the built-in platform and select the platform you want to use. the built-in platform is aliyun.
Open Alfred and enter trc target [english]
. You can see the built-in target language options, select the target language you want to translate into, the built-in is English (en).
Before using, set the API KEY for the platform you want to use. How to set, please see Environment variables
Open Alfred and type tr [enter the word or statement you want to translate]
. For example: tr 谁是世界上最可爱的人儿?
Press the enter
key or the cmd C
key to copy the translated text to the clipboard.
Press the cmd L
key to display the translation in large text.
name | value | description |
---|---|---|
ALIBABA_CLOUD_ACCESS_KEY_ID | If you use Alibaba Cloud Translation, set the corresponding ACCESS KEY ID. | |
ALIBABA_CLOUD_ACCESS_KEY_SECRET | If you use Alibaba Cloud Translation, set the corresponding ACCESS KEY SECRET | |
OPENAI_API_KEY | If you use OpenAI, set the corresponding OpenAi Key | |
VOCAENGINE_ACCESS_KEY_ID | If you use Volcano Translation, set the corresponding ACCESS KEY ID | |
VOCAENGINE_ACCESS_KEY_SECRET | If you use Volcano Translation, set the corresponding ACCESS KEY SECRET | |
BAIDU_APP_ID | If you use Baidu Translation, set the corresponding APP ID | |
BAIDU_APP_SECRET | If you use Baidu Translation, set the corresponding APP SECRET |
environment variables screenshots
If you download the workflow, you may have to manually set the hotkeys yourself.
Q: Why does the translation fail after setting the target language from the built-in language list?
The built-in languages are supported by aliyun by default. the translation languages supported by different platforms vary.
- alfy - Create Alfred workflows with ease