System-wide AI translation for macOS
Translayr is a system-wide intelligent translation assistant for macOS. It monitors text input in any application, detects language automatically, and provides instant translations. By combining the macOS Accessibility API with local AI models (Ollama), Translayr delivers powerful, private, and seamless cross-app translation.
- Key Features
- Download
- Quick Start
- Usage Guide
- How It Works
- Project Structure
- Development & Release
- Troubleshooting
- Roadmap
- Contributing & Community
- License
- Star History
- Cross-app monitoring: Detect and translate text in any macOS app (Notes, TextEdit, Safari, Chrome, etc.)
- Real-time detection: Automatic input field detection without manual triggers
- Intelligent text analysis: Tokenizes and recognizes phrases/sentences
- App allow/skip list: Exclude apps that should not be monitored
- Multilingual support: Top 10 most-used languages worldwide
- Chinese, English, Spanish, Hindi, Arabic, French, Bengali, Russian, Portuguese, Indonesian
- Local AI models: High-quality translation with Ollama, no internet required
- Bidirectional translation: Customizable source and target languages
- Context-aware: Uses full sentences for more accurate translation
- Floating underline: Colored underline for detected text
- Hover highlight: Visual feedback on hover
- Popup translation: Click underline to show translation popup
- One-click replace: Insert translation directly in the original app
- Smart positioning: Popup avoids covering text
- Auto-hide: Hides underline during scrolling, window movement, or space switching
- Fully local processing: Data never leaves your device
- Offline by design: No cloud services required
- Permission-controlled: Users control Accessibility permissions
- Language selection: Customize detection and target languages
- Color themes: Underline color options
- App filtering: Skip list for apps
- Model selection: Choose Ollama models
- Menu bar integration: Quick access from menu bar
- Auto-update checks: GitHub Releases-based update notifications
Requirements: macOS 15.0+ β’ Ollama
- Download the latest
.dmg - Open it and drag Translayr to Applications
- Launch and grant Accessibility permission
brew install ollama
ollama pull qwen2.5:3b
ollama serve- Download and open the
.dmgfile - Drag Translayr to Applications
- Launch and grant Accessibility permission
Type in any app β Click underlined text β Translate instantly
| Language | Code | Minimum Length | Unicode Pattern |
|---|---|---|---|
| Chinese | zh | 2 chars | CJK Unified Ideographs |
| English | en | 4 letters | Latin |
| Spanish | es | 3 letters | Latin + accents |
| Hindi | hi | 2 chars | Devanagari |
| Arabic | ar | 3 chars | Arabic |
| French | fr | 3 letters | Latin + accents |
| Bengali | bn | 2 chars | Bengali |
| Russian | ru | 3 letters | Cyrillic |
| Portuguese | pt | 3 letters | Latin + accents |
| Indonesian | id | 4 letters | Latin |
In the "Skip Apps" setting, add apps you donβt want to monitor:
Xcode, Terminal, iTerm, 1Password
Comma-separated, case-insensitive.
Select preferred underline color in "Colors":
- Red (default)
- Blue
- Green
- Purple
- Orange
Enter a model name in "Models" and save:
qwen2.5:3b
User types in any app
β
AccessibilityMonitor observes text changes
β
SpellCheckMonitor detects target language
β
OverlayWindow draws underline
β
User clicks underline
β
LocalModelClient calls Ollama
β
Translation popup appears
β
User selects translation
β
Text replaced in original app
Translayr/
βββ Translayr/
β βββ TranslayrApp.swift # App entry, menu bar integration
β βββ ContentView.swift # Main view
β β
β βββ Models/
β β βββ Suggestion.swift # Suggestion model
β β
β βββ Protocols/
β β βββ SpellAnalyzing.swift # Spell analysis protocol
β β
β βββ Services/
β β βββ AccessibilityMonitor.swift # Accessibility monitor
β β βββ SpellCheckMonitor.swift # Spell check coordinator
β β βββ SpellService.swift # Spell/translation logic
β β βββ LocalModelClient.swift # Ollama client
β β βββ SystemServiceProvider.swift # System service provider
β β βββ LanguageConfig.swift # Language configuration
β β βββ UpdateChecker.swift # Release update checker
β β
β βββ Views/
β β βββ OverlayWindow.swift # Floating underline window
β β βββ MenuBarView.swift # Menu bar view
β β βββ SettingsView/
β β βββ SettingsView.swift
β β βββ GeneralSettingsView.swift
β β βββ LanguageSettingsView.swift
β β βββ ColorSettingsView.swift
β β βββ SkipAppsSettingsView.swift
β β βββ ModelsSettingsView.swift
β β βββ PreferencesSection.swift
β β βββ AboutView.swift
β β
β βββ Info.plist # App configuration
β
βββ TranslayrTests/ # Unit tests
βββ scripts/
β βββ build-release.sh # Release build script
β βββ increment-build.sh # Build number bump
β βββ increment-version.sh # Version bump
β β
β βββ sign-and-notarize.sh # Signing + notarization
βββ README.md # Project overview
βββ DOCUMENT.md # Technical documentation
βββ USAGE.md # Usage manual
βββ SYSTEM_SERVICE.md # System service integration
βββ BUILD_RELEASE.md # Release build details
βββ QUICK_START.md # 5-minute quick start
βββ AGENTS.md # Agent guide
# Run with Xcode
open Translayr.xcodeproj
# Press β + R
# Or build from CLI
xcodebuild -scheme Translayr -configuration DebugAutomated scripts support signing and Apple notarization:
# 1. Bump version (optional)
./scripts/increment-version.sh # 1.0.0 β 1.0.1
./scripts/increment-build.sh # Build: 1 β 2
# 2. Build release (reads version from Info.plist)
./scripts/build-release.sh
# Output: build/Translayr-{version}.dmgRelease pipeline includes:
- Clean build directory
- Archive project
- Export .app
- Code signing (Developer ID)
- Create DMG
- Apple notarization
- Staple notarization ticket
See BUILD_RELEASE.md for details.
- macOS 13.0+
- Xcode 15.0+
- Ollama installed locally
Symptoms: Translayr is running but no text is detected
Fix:
- Confirm Accessibility permission
- System Settings β Privacy & Security β Accessibility β Enable Translayr
- Restart the target app
- Restart Translayr
- Ensure the app isnβt in the skip list
Symptoms: Clicking underline shows no translation
Fix:
- Ensure Ollama is running
If it fails, start Ollama:
curl http://127.0.0.1:11434/api/tags
ollama serve
- Ensure model is downloaded
If missing, download:
ollama list
ollama pull qwen2.5:3b
- Verify model name in Settings
Symptoms: Underline is not aligned with text
Fix:
- Translayr tracks window movement/resize automatically
- Re-type text in the app if it still misaligns
- Some apps do not expose precise text positioning
Symptoms: Long wait after clicking underline
Fix:
- First use loads the model (10β30 seconds); subsequent uses are faster
- Try a lighter model (e.g.,
gemma2:2b) - Ensure sufficient memory (8GB+ recommended)
- Close memory-heavy apps
Known limitations:
- Some apps (e.g., certain Electron apps) may not support Accessibility APIs
- Password fields are not accessible for security reasons
- Some IME input fields may not expose position APIs
- System-wide text monitoring
- Multi-language detection (10 languages)
- Real-time translation
- Floating underline hints
- One-click replacement
- Menu bar integration
- Configurable settings
- Skip app list
- Custom underline colors
- Auto-hide on window movement
- Auto-hide on scrolling
- Multi-screen/space switching detection
- Auto update check (GitHub Releases)
- Release build pipeline (signing + notarization)
Contributions are welcome via issues and pull requests:
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow Swift official style guidelines
- Add unit tests for new features
- Keep comments clear (bilingual preferred)
- Ensure tests pass before PR submission
Please include:
- macOS version
- Translayr version
- Ollama version and model
- Detailed issue description and reproduction steps
- Relevant logs (if available)
Released under the MIT License.
Made with β€οΈ for macOS
If Translayr is helpful, please consider giving it a βοΈ!