zen-Babel is a local-first translation app for Apple platforms (macOS / iOS). It is designed for on-device translation workflows where privacy, low latency, and offline-friendly behavior matter. In version 0.8.1, the app name changed from Pre-Babel Lens to zen-Babel (Japanese name: zenバベル).
Repository: https://github.com/ttrace/pre-babel-lens
- Swift + SwiftUI based app architecture
- Backend-swappable translation engines
- Deterministic preprocessing + observable translation pipeline
- iOS default runtime focuses on Apple Translation framework stability
- Foundation Models path is capability-gated and used for quality improvements when available
- On-device translation workflow (no mandatory cloud round-trip)
- Clutch mode (iOS / macOS): bidirectional segment highlighting between Source and Output
- Auto-scroll to corresponding segment when target is out of view
- macOS View controls: compact/column layout and text-size actions
- Import support:
- macOS: drag & drop / file import (
.txt,.md,.pdf,.docx, etc.) - iOS Share Panel: document import (
.pdf,.docx) - Image OCR via Vision framework
- macOS: drag & drop / file import (
- Quick Launch on macOS via double copy (
Cmd+C,Cmd+C)
- Select text in any app.
- Press
Command + Ctwice quickly (about 1 second). - zen-Babel comes to front and starts translation with the selected text.
Notes:
- macOS only.
- Empty clipboard content is ignored.
- Duplicate requests are suppressed.
You can launch translation from selected text via Automator Quick Action.
- Create a new
Quick Actionin Automator. - Set:
Workflow receives current:textin:any application
- Add
Run Shell Script(/bin/zsh, pass inputto stdin). - Use this script:
#!/bin/zsh
text="$(cat)"
if [ -z "$text" ]; then
text="$*"
fi
if [ -z "$text" ]; then
exit 0
fi
encoded="$(printf '%s' "$text" | /usr/bin/python3 -c 'import sys, urllib.parse; print(urllib.parse.quote(sys.stdin.read()))')"
open "prebabellens://translate?text=${encoded}"- Save (for example:
Translate with zen-Babel). - Assign a keyboard shortcut in
System Settings > Keyboard > Keyboard Shortcuts > Services.
The app prioritizes completion and visibility of failures:
- Per-segment fallback to source text when translation is unavailable/unsafe
- Retry guards for recoverable engine errors
- Explicit propagation of cancellation (no hidden fallback on user stop)
- Observable diagnostics in Developer Console
Sources/App/: app entry points and lifecycleSources/Features/Translation/: translation UI and stateSources/Domain/: core models and protocolsSources/Engines/Preprocess/: preprocessing enginesSources/Engines/Translation/: translation backendsSources/Services/: orchestration, policy, diagnosticsTests/: unit/integration tests
swift build is for core/development verification (SwiftPM build), not a distributable .app bundle build.
swift buildswift testUI strings are managed in Localizable.strings under:
Sources/Resources/en.lproj/Localizable.stringsSources/Resources/ja.lproj/Localizable.stringsSources/Resources/ko.lproj/Localizable.stringsSources/Resources/zh-Hans.lproj/Localizable.stringsSources/Resources/zh-Hant.lproj/Localizable.strings
How to add/update localized text:
- Add a key in code via
localized("your.key", defaultValue: "...")(orNSLocalizedStringwith the same key). - Add/update the same key in
en.lproj/Localizable.stringsfirst (source of truth). - Add/update the key in each supported locale file.
- Keep key names stable; do not rename existing keys unless necessary.
- Build and verify labels in app menus and translation screens.
Notes:
defaultValueshould be clear fallback English text.- Prefer adding new keys instead of overloading old keys with different meaning.
Official artifacts are built and signed locally on macOS, then notarized and stapled locally. Do not treat GitHub-hosted CI build artifacts as official distributables.
Preferred script:
scripts/build_notarized_release.shNotarization credentials:
- Recommended:
NOTARY_PROFILE(Keychain profile fromxcrun notarytool store-credentials) - Fallback:
APPLE_ID+ app-specific password +APPLE_TEAM_ID
Typical flow:
- Local release build
- Developer ID codesign
- Notarization submit/wait
- Staple + validate
This project is licensed under the MIT License. See LICENSE.
