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.
- Features
- User Requirements
- Downloads
- Installation and Setup
- How To Uninstall
- Development
- Attribution
- Other
- Translation (Google translate, LibreTranslate, Mymemorytranslator, Deepl, Pons)
- OCR Detection (Using tesseract OCR)
- Snip and translate
- Capture and translate
- 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.
- The application (ScreenTranslate/STL)
- Tesseract (v5.0.0-alpha2021081 or higher)
- LibreTranslate (Optional)
- Download the latest release of this program
- 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
- Open the app and adjust setting to your liking
- (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)
- (Optional) Set offset if on multiple monitors.
- 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.
- 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.
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.
Note
It is recommended to create a virtual environment, but it is not required.
- Clone the repo or download the source code of the latest release
- Create your virtual environment by running
python -m venv venv
- Activate your virtual environment
- Install all the dependencies needed by running
pip install -r requirements.txt
- Get to root directory and Run the script by typing
python Main.py
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.
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.
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.
- Translate Icon in the logo is taken from Icons8
- Sunvalley TTK Theme (used for app theme although i modified it a bit)
Check out my other similar project called Speech Translate a real time speech transcription and translation app made possible using whisper model from openAI.