Skip to content

amaralkaff/screen-translate

Repository files navigation

Screen Translate

select text anywhere. get instant translation. all local.


highlight text with your mouse and a popup appears with the translation. works with any app. everything runs on your machine via libretranslate.

installation

Option 1: Bundled Installer (Recommended)

Download the latest release from GitHub Releases:

Windows:

  • Download ScreenTranslate-Full-x.x.x-setup.exe
  • Run the installer (includes bundled Python 3.12 + LibreTranslate)
  • Auto-starts on login via registry
  • Everything works offline immediately

macOS:

  • Download ScreenTranslate-x.x.x-macOS.dmg
  • Drag Screen Translate.app to Applications
  • Grant Input Monitoring permission (System Settings > Privacy & Security)
  • First launch downloads language models (~2-5 min)

Enable auto-start on macOS:

cp '/Applications/Screen Translate.app/Contents/Resources/com.amaralkaff.screen-translate.plist' \
   ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.amaralkaff.screen-translate.plist

Option 2: Manual Build (Advanced)

1. install libretranslate

# Windows
py -3.12 -m venv ../libretranslate
../libretranslate/Scripts/pip install libretranslate
../libretranslate/Scripts/pip install 'setuptools==67.8.0'

# macOS
python3.12 -m venv ../libretranslate
../libretranslate/bin/pip install libretranslate
../libretranslate/bin/pip install 'setuptools==67.8.0'

⚠️ IMPORTANT: Use Python 3.12 only. Python 3.13+ and 3.14 are not compatible. Setuptools 67.8.0 required for pkg_resources compatibility.

2. build and run

cargo build --release
cargo run --release

auto-starts libretranslate if not running. first launch downloads language models (~2-5 min). subsequent launches are fast.

macOS note: on first launch, macOS will prompt for Input Monitoring permission. grant it in System Settings > Privacy & Security > Input Monitoring, then relaunch.

3. configure (optional)

config location:

  • macOS: ~/Library/Application Support/screen-translate/config.toml
  • Windows: %APPDATA%/screen-translate/config.toml
target_lang = "id"
source_lang = "auto"
poll_interval_ms = 300
load_languages = "en,id"

fewer languages = faster startup. only load what you need.

see config.example.toml for all options.

how it works

select text → copy simulated (Cmd+C / Ctrl+C) → libretranslate api → popup appears above selection
  • Windows: Win32 mouse hook + layered window with GDI rendering
  • macOS: CGEventTap + NSPanel with vibrancy (Liquid Glass on macOS 26+)

troubleshooting

libretranslate crashes on startup / flickering windows: recreate venv with Python 3.12 and correct setuptools:

py -3.12 -m venv ../libretranslate
../libretranslate/Scripts/pip install libretranslate 'setuptools==67.8.0'

libretranslate won't start: make sure venv exists at ../libretranslate/ relative to the exe.

macOS port 5000 conflict: macOS uses port 5000 for AirPlay. screen-translate defaults to port 5001 on macOS.

macOS permission denied: enable both Input Monitoring and Accessibility in System Settings > Privacy & Security. The app needs Input Monitoring for mouse events and Accessibility for copy simulation (Cmd+C).

no popup: check tray icon — monitoring might be toggled off.

slow first run: models are downloading. reduce load_languages to speed things up (e.g. "en,id").

roadmap

done

  • windows support (Win32 mouse hook + layered window)
  • macos support (CGEventTap + NSPanel + Liquid Glass)
  • bundled installer (Windows Inno Setup, macOS DMG)
  • on-demand language downloads (18 languages)
  • system tray with language switcher
  • auto-update from GitHub releases
  • accessibility + input monitoring permission checks (macOS)
  • offline translation via bundled LibreTranslate

linux support

  • X11 text selection detection (XInput2 / XGrab)
  • Wayland text selection (wlr-data-control / portal API)
  • popup window (GTK4 or X11 overlay)
  • xdotool / wtype for copy simulation (Ctrl+C)
  • system tray via StatusNotifierItem / XEmbed
  • .deb and .AppImage packaging
  • CI build for x86_64-unknown-linux-gnu

planned

  • translation cache (avoid re-translating same text)
  • hotkey toggle (global shortcut to enable/disable)
  • OCR mode (translate text from images / non-selectable UI)
  • multiple translation engines (DeepL, Google, custom API)
  • dictionary mode (show definitions for single words)
  • theme support (light/dark/custom popup styles)
  • Apple Developer ID signing (preserve permissions across updates)

About

select text anywhere. get instant translation. all local.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors