A minimal macOS “selection translator” popover for language learners.
- Floating, glass-like popup near the mouse cursor
- Global hotkey to translate the current selection (Accessibility / AXUIElement)
- OpenAI-compatible streaming (works with OpenAI / DeepSeek and many gateways)
- Free Google translate fallback (non-streaming)
- English word learning mode: single-word selections render a dictionary-style card (US IPA + POS senses) with Text-to-Speech
- Settings: source/target language, hotkey, launch at login, engine selection, custom OpenAI-compatible engines
- Click outside the popup to dismiss and clear content
- macOS 14+
- Xcode 15+ (for building from source)
- Select text in any app.
- Press the global hotkey (default:
⌘⇧L). - Lexi shows a floating popup near your mouse with the translation result.
- Click anywhere outside the popup to close it.
Lexi needs Accessibility permission to read the selected text from other apps.
- System Settings → Privacy & Security → Accessibility → enable Lexi
- If you just enabled it, restart Lexi once.
Open Settings… from the menu bar icon or the popup’s gear button.
- Google (free, non-streaming; may be rate-limited)
- gpt-4o (OpenAI-compatible, streaming)
- deepseek-chat (OpenAI-compatible, streaming; set Base URL to DeepSeek)
- OpenAI:
https://api.openai.com/v1 - DeepSeek:
https://api.deepseek.com(Lexi auto-completes/v1/chat/completions)
API Keys are stored in macOS Keychain (not in UserDefaults).
In Settings, you can add custom OpenAI-compatible engines by providing:
- Engine name (optional)
- Base URL
- Model
- API Key (optional; falls back to the global key if empty)
- Open
Lexi.xcodeproj, select theLexischeme, and run. - CLI build:
xcodebuild -scheme Lexi -configuration Debug -destination 'platform=macOS' build- Hotkey does nothing: confirm Accessibility is enabled for Lexi; check if the hotkey conflicts with another app.
- No popup appears: Lexi won’t show the popup if the selection is empty.
- HTTP 401/429 or network errors: check the API Key, Base URL, and your quota/network.
See Architecture.md.
- Selected text may be sent to the chosen translation provider (OpenAI/DeepSeek/Google). Avoid translating sensitive content if you don’t trust the provider.
- API Keys are stored in macOS Keychain.
This project is licensed under the MIT License. See the LICENSE file for details.
