An extremely simple Tkinter DeepL translation application.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
J. Sims 599c86617a Add and document in-app key loading 6 months ago
LICENSE.md Initial commit 6 months ago
README.md Add and document in-app key loading 6 months ago
main.py Add and document in-app key loading 6 months ago

README.md

Python DeepL Translator

An extremely simple, cross-platform translator using the DeepL Free API.

Overview

This simple translator application does one thing and one thing only: it sends off text to the DeepL Free API to be translated. That's it! (This functionality may be extended in the future to enable document translation.)

Requirements

  • DeepL API Key
  • Python >= 3.8
  • Tkinter

Firstly, you'll need to get a DeepL API key. You'll need to set this as an environment variable called DEEPL_AUTH_KEY in the environment where you're running the program. For example, on a Unix-like OS open a terminal and type:

export DEEPL_AUTH_KEY="supposed-to-be-an-alphanumeric-string"

If you plan to use this regularly, you may want to put the above line (with your actual key) in a plaintext file and then simply source /path/to/key-file.txt.

Alternatively, you can simply put your DeepL key in a text file and load it using the "Load Key" button in the application.

Secondly, you'll need Python >= 3.8 and Tkinter. If you're using a Unix-like OS, you should already have Python, and need only confirm you have Tkinter. On many Linux-based distributions, you'll need to install Tkinter through your package manager. I cannot afford a Mac to know if it's already installed there.

If you're on Windows, you'll need to download Python, but this version should bundle Tkinter.

Usage

git clone https://git.trees.st/Marie-Joseph/DeepL-Translator.git
cd DeepL-Translator
source /path/to/API/key.txt # or: export DEEPL_AUTH_KEY="your-API-key"
python main.py

From there, simply enter the text you desire translated on the left, select the target language from the list on the upper-right, and click "Translate".

Bugs, Issues, Quirks, etc.

  • the free API has a limited language set and only these are provided as targets
  • Tkinter's listboxes are tricky so only target languages are supported; source language is determined automatically (hopefully this will change)