Skip to content

laszekQ/COT

Repository files navigation

COT

Crossplatform OCR Translation tool COT for translating text on your screen.

Currently supports DeepL and LibreTranslate as translation APIs, and Tesseract as an OCR engine.

Demonstration

Features 2 modes:

  • Notification
    Uses native notifications to show the translation.
    Ideal for translating small phrases and separate words. Notification

  • TextBox
    Prints translated text near your selection.
    Ideal for translating big chunks of text. TextBox

Requirements

  • Java 21+
  • Network connection

Installation

  1. Download the latest archive from the Releases tab and extract the contents.
  2. Download .traineddata files for Tesseract for the languages you are going to translate:
    Fast versions
    Default versions
    And put them in ocrdata/tessdata/
  3. Get your DeepL or Libre API key:
    DeepL
    Libre (no free plan)
  4. Paste your key in the corresponding file:
    api/Deepl/key.txt
    api/Libre/key.txt
  5. Run the .jar executable in the root folder.
  6. Set your preferred input and output languages, presentation mode and translator(DeepL by default).
  7. Use Ctrl + Shift + C to select a region you want to translate.

Note: If you use TextBox mode or encounter some error, use the shortcut to hide the selection overlay

Shortcut

You can change the shortcut by editing the assets/shortcut.txt file.

Currently known problems

  • Tesseract may fail to read selected text.
  • Tesseract may recognise abstract shapes as characters.

These can not be fully fixed.

Acknowledgements

This project uses JNativeHook, Tess4J, DeepL Java Library.

Packages

 
 
 

Contributors

Languages