ctrl-c ctrl-c
for DeepL apps that can be used on Windows and Mac
You can easily translate what you have copied with and read English.
I wanted to do the same with Linux. When I looked it up, there were some things like deepl cli, and I thought I'd make a simple app using this, but now it seems that I can not access the translation results without using the official api of the pro version. So I decided to access it from a browser.
There was a similar thing done by @ masan4444 DeepL Translator on Linux. Just register the shell script in the shortcut. It is easy to use with. (Thank you for your reference.)
But personally,
――I want you to translate in the same tab without opening the tab every time you translate. --I want to easily switch the language of the translation source and translation destination. --I want to translate with a browser different from the browser for browsing.
I wanted to do that, so I made it.
clip-translator https://github.com/kosuke55/clip-translator
Install Check the version of google chrome.
google-chrome --version
Google Chrome 81.0.4044.113
Install the chromedriver_binary closest to the version you checked.
sudo pip install chromedriver_binary==81.0.4044.138.0
Install the following packages (PyPI not registered)
git clone https://github.com/kosuke55/clip-translator.git
cd clip-translator
sudo pip install -e .
Setting
Search for keyboard and select the shortcuts and custom shortcuts fields.
Press the + button and register the shortcut as shown in the image below.
(In the example, ctrl-alt-c is set.)
.
Run From the terminal
clip_translatate_s
Then the browser will be launched.
After the browser is launched, copy the text with ctrl-c and press ctrl-alt-c, and it will be automatically sent to deepl for translation.
Options
clip_translate_s -h
usage: clip_translate_s [-h] [--source SOURCE] [--target TARGET] [--mode MODE]
optional arguments:
-h, --help show this help message and exit
--source SOURCE, -s SOURCE
source language (default: en)
--target TARGET, -t TARGET
target language (default: ja)
--mode MODE, -m MODE Translation site (deepl or google) (default: deepl)
If you want to use google translate instead of deepL
clip_translatate_s -m google
And.
I feel like I was able to do what I wanted to do for the time being. I will put up with this until the official app comes out.
Recommended Posts