Skip to content

Latest commit

 

History

History
162 lines (118 loc) · 8.49 KB

readme.md

File metadata and controls

162 lines (118 loc) · 8.49 KB

Screen Translate Logo

Screen Translate - An Easy to Use OCR Translator

GitHub issues GitHub pull requests github downloadssourceforge downloads
GitHub release (latest SemVer) GitHub commits since latest release (by date)
GitHub Repo stars GitHub forks

STL a.k.a Screen Translate is an OCR translator tool made by utilizing Tesseract and opencv-python. The code is then compiled to .exe by using pyinstaller. Inspired by software such as Visual Novel Reader (VNR), Visual Novel OCR, and QTranslate. Also available to download at sourceforge.

GitHub forks

Jump to



Screen Translate Preview

Features

  • Translation (Google translate, LibreTranslate, Mymemorytranslator, Deepl, Pons)
  • OCR Detection (Using tesseract OCR)
  • Snip and translate
    Example Screen Translate Looks Screen Translate Looks
  • Capture and translate
    Example Screen Translate Looks Screen Translate Looks Screen Translate Looks

User Requirements

  • tesseract, needed for the ocr. Install it with all the language pack. (Tested version is v5.0.0-alpha2021081, higher version should also work)
  • LibreTranslate for offline translation (Optional).
  • Internet connection for translation if not using LibreTranslate.

Downloads

Installation and Setup

  1. Download the latest release of this program
  2. Install tesseract, make sure to select install all language pack when prompted. Optionally you can found the language pack tessdata in teserract repository such as this
  3. Open the app and adjust setting to your liking
  4. (Recommended) Set monitor scaling to 100% so that image is captured accurately (If scaling is not set to 100% you will need to set offset in setting)
  5. (Optional) Set offset if on multiple monitors.
  6. Try capturing image and see if it works or not, if it doesn't, go check the image captured in img_captured folder to see wether it capture the stuff that you want or not. If not, try to change the offset.
  7. Now that you have set everything, the app should be ready. Feel free to submit new issue on the github repository if you encounter any bugs.

How To Uninstall

If you use the installer version, you can run the uninstaller inside the app folder or uninstall it from control panel. For the portable (rar) version, you can just delete them.


- Development -

Setup

Note
It is recommended to create a virtual environment, but it is not required.

  1. Clone the repo or download the source code of the latest release
  2. Create your virtual environment by running python -m venv venv
  3. Activate your virtual environment
  4. Install all the dependencies needed by running pip install -r requirements.txt
  5. Get to root directory and Run the script by typing python Main.py

Building

Warning
As of now cx_Freeze setup is not working properly for DeepL scraper so use the pyinstaller script instead if you want to compile the app by yourself.

Before building, we gotta make sure that the dependencies and playwright driver is installed. For playwright (used for deepl scraper), we need to install the browser driver first, which is explained in the playwright documentation. It is stated there that if we want to bundle our code we need to run the following code first:

# bash
PLAYWRIGHT_BROWSERS_PATH=0 playwright install chromium

# powershell
$env:PLAYWRIGHT_BROWSERS_PATH="0"
playwright install chromium

# batch
set PLAYWRIGHT_BROWSERS_PATH=0
playwright install chromium

After dependencies are installed, we can start building the app. There are 2 options that i have provided for building, using pyinstaller or cx_freeze. The command used are:

For pyinstaller:

# On Source Code Directory
python build_pyinstaller.py
# you will be prompted to build with console or not

This will create a folder called dist in the source code directory. Inside the folder there will be a folder called ScreenTranslate <version> which contains the executable file.

For cx_freeze:

# On Source Code Directory
python build_cx.py build
# you will be prompted to build with console or not

This will create a folder called build in the source code directory. Inside the folder there will be a folder called exe.<platform>-<version> which contains the executable file.

Packaging

I use innosetup to package the app. You can download it here. After installing it, you can setup the path and AppId in ScreenTranslate.iss file and run the .iss script.

Contributing

If you encounter any bugs with the program, please report them by opening an issue on the github repository. You can also request a feature by opening an issue or posting in discussion.

Attribution

Other

Check out my other similar project called Speech Translate a real time speech transcription and translation app made possible using whisper model from openAI.