Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wxyucs/alfred-quick-translation-workflow
An Alfred workflow that can automatically translate text.
https://github.com/wxyucs/alfred-quick-translation-workflow
chinese-translation translation
Last synced: 12 days ago
JSON representation
An Alfred workflow that can automatically translate text.
- Host: GitHub
- URL: https://github.com/wxyucs/alfred-quick-translation-workflow
- Owner: wxyucs
- License: mit
- Created: 2021-01-02T18:23:38.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-08T18:08:52.000Z (over 3 years ago)
- Last Synced: 2024-11-10T18:50:38.798Z (2 months ago)
- Topics: chinese-translation, translation
- Language: Python
- Homepage:
- Size: 92.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Alfred Quick Translation workflow
A translation workflow based on Google Translate.This workflow will automatically detect the language of the input text, if the input text is Chinese, it will be translated into English, otherwise it will be translated into Chinese.
At the same time, this workflow also supports copying the original translation or translation result to the clipboard.
## Setup
There are two environments required in this workflow:
- `key` is the API key of [Cloud Translation API](https://console.cloud.google.com/marketplace/product/google/translate.googleapis.com)
- `python` is the python path to execute this workflowTo get a API Key: click the "CREATE CREDENTIALS" in [this page](https://console.cloud.google.com/apis/api/translate.googleapis.com/credentials), and select the `API key`. A new API key will appear below. Click the `Copy API Key` button, the API Key will be copied to the clipboard.
> This workflow depends on the Cloud Translation API on GCP(Google Cloud Platform). It is assumed that you already have a GCP account, if you don’t have one, you can create one for free.
To get the Python path: open a terminal and run this command:
```shell
$ which python3
```The Python path will be output to the console.
> Please make sure the `requests` package has been installed in this python sites-packages. You can use this command to check:
>
> ```shell
> $ python3 -c "import requests"
> ```## Usage
### Translate (tr)
![translate](./imgs/translate.png)
Use Google Translate to translate the entered text.
**Keyword: tr**
### Copy the original text to Clipboard (⌥ + ⏎)
![source](./imgs/source.png)
Press ⌥ + ⏎ to copy the original text to the clipboard.
### Copy translation results to Clipboard (⌘ + ⏎)
![source](./imgs/target.png)
Press ⌘ + ⏎ to copy the translation result to the clipboard.
## License
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)