How cat-in-a-box/decky-translator works
Decky Translator is a Steam Deck screen-translation plugin. The user starts a translation from the plugin UI or a configured quick-toggle control; the backend captures the screen, runs the selected OCR and translation providers, and returns translated regions for an on-screen overlay. Settings and model downloads configure this workflow, while provider choices include offline and web-based alternatives. The README documents the provider capabilities; because much of main.py and provider wiring was not sampled, uncertain internal calls are omitted.
Main entry points: main.py Decky backend · index.tsx Plugin entry · __init__.py Provider manager · Translator.tsx Translation workflow
Components 20
Plugin interface
- Plugin entry
src/index.tsx - Settings context
src/SettingsContext.tsx - Main tab
src/tabs/TabMain.tsx - Translation settings
src/tabs/TabTranslation.tsx - Control settings
src/tabs/TabControls.tsx - Translation workflow
src/Translator.tsx - Result overlay
src/Overlay.tsx - Overlay fonts
src/fonts/index.ts
Capture and orchestration
- Decky backend
main.py
Recognition and translation
- Provider manager
py_modules/providers/__init__.py - OCR providers
py_modules/providers - Gemini Vision
py_modules/providers/gemini_vision.py - Translation providers
py_modules/providers - Offline NLLB worker
py_modules/providers/ct2_translate_worker.py
Configuration and models
- Persisted settings
main.py - Translation cache
py_modules/providers/translation_cache.py - Model downloads
py_modules/providers
Other components
- Steam Deck user
- Steam Deck screen
- Web provider APIs
Connections 25
- Steam Deck user → Plugin entry: opens plugin
- Plugin entry → Main tab: shows main tab
- Plugin entry → Translation settings: shows settings
- Plugin entry → Control settings: shows controls
- Plugin entry → Settings context: provides settings
- Settings context → Decky backend: loads and saves
- Main tab → Translation workflow: starts translation
- Control settings → Decky backend: configures controls
- Translation settings → Decky backend: configures providers
- Translation workflow → Decky backend: requests translation
- Decky backend → Steam Deck screen: captures image
- Decky backend → Provider manager: selects providers
- Provider manager → OCR providers: dispatches OCR
- Provider manager → Translation providers: dispatches translation
- OCR providers → Web provider APIs: sends image
- Translation providers → Web provider APIs: sends text
- Provider manager → Gemini Vision: selects integrated OCR
- Gemini Vision → Web provider APIs: sends image request
- Translation providers → Offline NLLB worker: runs offline translation
- Decky backend → Translation cache: reads and writes
- Decky backend → Persisted settings: reads and writes
- Provider manager → Model downloads: manages model availability
- Decky backend → Translation workflow: returns regions
- Translation workflow → Result overlay: provides translated regions
- Result overlay → Overlay fonts: loads font options