Skip to content

基于Electron的屏幕翻译工具,支持OCR和翻译服务与大模型翻译。/An Electron-based screen translation tool that combines OCR, translation services and VLM translation.

Notifications You must be signed in to change notification settings

scriptLin-bjtu/ScreenTranslator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScreenTranslator

中文

License: ISC

An Electron-based screen translation tool that combines OCR and translation services.

show1 show2 show3

Features

  • Screen capture and region selection
  • Text recognition using PaddleOCR
  • Translation services (Youdao/Bing)
  • VLM Translation (GLM-4.1V-flash)
  • Hotkey support for quick access
  • Cross-platform support (Windows/macOS/Linux)

Quick Start

Prerequisites

  • Node.js 16+
  • Python 3.7+
  • Git

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/ScreenTranslator.git
cd ScreenTranslator
  1. Set up Python environment (for OCR service):
cd paddleocr2
python -m venv venv
venv\Scripts\activate  # Windows
source venv/bin/activate  # Linux/macOS
pip install paddlepaddle paddleocr flask pillow
  1. Install Node.js dependencies:
cd ../app
npm install

Running the Application

  1. Start the OCR service (in one terminal):
cd paddleocr2
python main.py
  1. Start the Electron app (in another terminal):
cd app
npm start

Usage

  • Press the configured hotkey to capture screen region
  • Selected text will be automatically recognized and translated
  • Choose between traditional or VLM mode

Configuration

OCR Settings

Edit paddleocr2/main.py to modify:

  • OCR language settings
  • Server port (default: 6987)

Translation Settings

Edit app/config/translateServer to change:

  • Default translation service
  • API endpoints

Development

Project Structure

  • app/: Electron application (frontend)
    • main.js: Main process
    • puppeteer.js: Translation handling
    • tools.js: Utility functions
  • paddleocr2/: OCR service (backend)
    • main.py: Flask server with PaddleOCR

Building for Production

cd app
npm run dist

Notice

  1. About PaddleOCR service packaging issues, please refer to: PaddleOCR Discussion #11490
  2. If using traditional translation mode, you need to download OCR service files and configure the OCR file path in the software. If using large model translation mode, you need to configure the API key in the software.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

ISC © [ScriptLin]

About

基于Electron的屏幕翻译工具,支持OCR和翻译服务与大模型翻译。/An Electron-based screen translation tool that combines OCR, translation services and VLM translation.

Resources

Stars

Watchers

Forks

Packages

No packages published