Skip to content

jawasch/DeepL-integration-in-Linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

DeepL Clipboard Translator

This script translates the content of the clipboard from English to German if it is in English language and vice versa. This is done by detecting a double press of Ctrl+C (within 0.5 seconds) and copying the translation back to the clipboard. The script uses the DeepL API for the translation.

Usage

  1. Start the script with python3 clipboard_translator.py
  2. Copy some text to your clipboard (e.g. by selecting it and pressing Ctrl+C).
  3. Press Ctrl+C twice in a row. The script will translate the text from English to German and copy the result to the clipboard and also automatically Pastes it if possible.

Requirements

Setup

  1. Install Python 3.
  2. Install the required packages with pip install deepl pynput clipboard langdetect (or pip3 instead of pip).
  3. Create a .env file to save your API_KEY only locally.
  4. Get a free DeepL API Key by signing up for a DeepL Pro account here.
  5. Copy the API Key from the DeepL Pro Account Page into the API_KEY variable in the .env file.
API_KEY=your_api_key_as_displayed_by_DeepL
  1. Start the script with python clipboard_translator.py
  2. Copy some text to your clipboard (e.g. by selecting it and pressing Ctrl+C). -> You`re already doing this by double tapping Ctrl+C twice
  3. Press Ctrl+C twice in a row. The script will translate the text from the detected language to English or if detected English to German and copy the result to the clipboard.
  4. Press Ctrl+V to paste the translation somewhere.

This was created by the help of GPT-4 by OpenAI

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages