Instant translation for developers who live in the terminal.
Select text → click → translated. No context switching.
Install • How it Works • Features • Configuration • Supported Terminals • Build from Source • Contributing
DemoDevTranslator.mov
If the video doesn't load, watch the demo here.
You're deep in a Claude Code session. An error message appears. A Stack Overflow answer is half in English, half jargon you need to look up. You copy the text, open a browser tab, paste it into Google Translate, read the result, switch back to the terminal. Flow broken.
DevTranslator fixes this. Highlight any text in your terminal, click the floating icon, and the translation appears right there. No tab switching, no copy-paste, no interruption.
Built for non-native English developers working with agent coding tools, terminal-heavy workflows, and CLI environments.
curl -fsSL https://raw.githubusercontent.com/delee03/DevTranslator/main/install.sh | shThat's it. The script will:
- Detect your Mac's architecture (Apple Silicon or Intel)
- Download the correct release binary when one is available
- Fall back to building from source with SwiftPM when release assets are not available yet
- Install the binary under
~/.local/binby default - Prompt for macOS Accessibility permission (required for text selection detection)
To force a source build:
curl -fsSL https://raw.githubusercontent.com/delee03/DevTranslator/main/install.sh | sh -s -- --from-sourceTo uninstall:
curl -fsSL https://raw.githubusercontent.com/delee03/DevTranslator/main/install.sh | sh -s -- --uninstall ① Select text in any terminal
┌─────────────────────────────────────────┐
│ $ Error: Cannot find module 'express' │
│ ~~~~~~~~~~~~~~~~~~~~~~~~ ← You │
│ select │
│ [Dt] ← ② Icon appears
└─────────────────────────────────────────┘
③ Click the icon → translation popup
┌──────────────────────────────────────┐
│ Lỗi: Không tìm thấy module │
│ 'express' │
│ [Copy] │
└──────────────────────────────────────┘
- Select — Highlight any text in your terminal
- Click — A small
Dticon appears near your selection - Read — Translation popup shows the result in your language
You can also use the keyboard shortcut Cmd+Shift+T instead of clicking.
Translation popup — Select text anywhere in your terminal, get an instant translation popup. Default target language is Vietnamese, configurable to 100+ languages.
CLI translate — Use it directly from the command line without the GUI:
# Translate text
devtranslator "Build failed: missing dependency"
# → Xây dựng không thành công: thiếu phụ thuộc
# Pipe support
echo "Permission denied" | devtranslator
# Translate to a different language
devtranslator --lang ja "Good morning"
# → おはようBackground daemon — Runs silently in the background, monitoring text selection:
devtranslator start # Start the daemon
devtranslator stop # Stop the daemon
devtranslator status # Check if running
devtranslator toggle # Pause/resume without killingMenu bar app — A small icon in your macOS menu bar to toggle, switch languages, and access preferences.
Zero config — Works out of the box. No API key, no account, no setup.
Lightweight — < 10MB RAM, < 0.1% CPU when idle. You won't notice it's there.
Config lives at ~/.config/devtranslator/config.json:
{
"targetLang": "vi",
"sourceLang": "",
"shortcut": "cmd+shift+t",
"autostart": true,
"showSelectionIcon": true,
"popupDuration": 10,
"apiTimeoutMs": 3000,
"cacheSize": 500,
"allowedApps": [
"com.apple.Terminal",
"com.googlecode.iterm2",
"com.mitchellh.ghostty",
"com.microsoft.VSCode",
"com.microsoft.VSCodeInsiders",
"com.todesktop.230313mzl4w4u92",
"dev.warp.Warp",
"dev.warp.Warp-Stable",
"net.kovidgoyal.kitty",
"org.alacritty"
]
}Or configure via CLI:
# Change target language
devtranslator config --lang ja # Japanese
devtranslator config --lang ko # Korean
devtranslator config --lang zh-CN # Chinese (Simplified)
# View current config
devtranslator config
# Reset to defaults
devtranslator config --resetVietnamese (vi), Chinese Simplified (zh-CN), Chinese Traditional (zh-TW), Japanese (ja), Korean (ko), Spanish (es), Portuguese (pt), Thai (th), Indonesian (id), and 100+ more.
DevTranslator works with any terminal app that exposes text selection via macOS Accessibility API:
| Terminal | Status |
|---|---|
| Terminal.app | ✅ Fully supported |
| iTerm2 | ✅ Fully supported |
| Kitty | ✅ Fully supported |
| Warp | ✅ Fully supported |
| Alacritty | ✅ Fully supported |
| VS Code (integrated terminal) | ✅ Fully supported |
| Cursor (integrated terminal) | ✅ Fully supported |
Note: Accessibility permission must be granted in System Settings → Privacy & Security → Accessibility. DevTranslator will prompt you on first launch.
- macOS 13.0 (Ventura) or later
- Swift 5.9+ (Xcode 15+ or Command Line Tools)
git clone https://github.com/delee03/DevTranslator.git
cd DevTranslator
swift build# CLI mode
swift run devtranslator "Hello, world!"
# Start daemon (Phase 2)
swift run devtranslator startswift test --enable-swift-testing --disable-xctest# Universal binary (Apple Silicon + Intel)
swift build -c release --arch arm64 --arch x86_64
# Binary will be at .build/apple/Products/Release/devtranslatorDevTranslator uses the same translation endpoint that Google Translate's web frontend uses internally — no API key required. This is the same approach used by translate-shell and many other open-source tools.
GET https://translate.googleapis.com/translate_a/single
?client=gtx&sl=en&tl=vi&dt=t&q=<text>
Translations are cached in-memory (default: 500 entries) so repeated lookups are instant.
Privacy: Your text is sent to Google's translation servers over HTTPS. No data is stored by DevTranslator — zero telemetry, zero analytics. If this concerns you, we plan to support self-hosted backends like LibreTranslate in the future.
Stream daemon logs in real time:
log stream --predicate 'subsystem == "com.devtranslator"' --level debugShow recent logs (last 60 seconds):
log show --predicate 'subsystem == "com.devtranslator"' --last 60s --style compactCheck daemon status and diagnose issues:
devtranslator status
devtranslator diagnose- Translation engine with Google Translate
- CLI interface with pipe support
- In-memory LRU translation cache
- JSON config system
- Text selection detection daemon
- Floating translation popup
- macOS menu bar app
- Keyboard shortcut trigger (
Cmd+Shift+T) - LaunchAgent auto-start on login
- LibreTranslate / DeepL backend support
- Linux support (X11/Wayland text selection)
We welcome contributions! Whether it's a bug fix, new feature, documentation improvement, or terminal compatibility report — every contribution helps.
Please read our Contributing Guide before submitting a PR.
- Inspired by Ddict — the Chrome extension that started it all
- Translation API approach informed by translate-shell
- Selection detection inspired by Easydict — a fantastic open-source macOS dictionary app
MIT © delee03
Built for developers who think in two languages.