Replace the single reverse-direction pair with a general routing table. The saved target is the mother tongue and the default target for every source; languageRoutes is an empty-by-default, source-unique list of source-to-target rules (for example Chinese -> English, Traditional Chinese -> English, German -> English). Rules apply only when the source is confidently detected; otherwise the mother tongue is used. Same-language rules are dropped.\n\nThe panel shows the effective direction and a banner explaining a rule, with a one-capture override back to the mother tongue; the panel picker is now a session-only override. Persistent rules are edited in Settings. The old autoSwitchTarget/fallbackTargetLanguage keys are ignored, so the default after migration is everything -> mother tongue.\n\nAdd LanguageRoute, generalize the direction policy and tests, add the rules UI, and update ADR-022, architecture, translation output, user guide, README and progress. Verified: make verify green; empty rules translate French -> German, a Chinese -> English rule produces Chinese (Simplified) -> English with the banner, and the rules table renders in Settings.
4.8 KiB
Sprachmittler — user guide
Sprachmittler translates the text you select, locally, with Tencent's Hy-MT3 model in Ollama. Nothing is sent to a cloud service and no history is kept.
1. Install Ollama and the model
-
Install Ollama from https://ollama.com/download.
-
Open Terminal and run:
ollama pull hf.co/tencent/Hy-MT3-7B-GGUF:Q4_K_MThis is the 7.5B model (about 5.15 GB download). The smaller Fast model is optional:
ollama pull hf.co/tencent/Hy-MT3-1.8B-GGUF:Q4_K_M -
Leave Ollama running. Sprachmittler uses
http://127.0.0.1:11434by default.
2. Install Sprachmittler
Build and install from the repository:
make install
The app appears in the menu bar. There is no Dock icon. On first launch, setup checks Ollama, the Hy-MT3 model and the target language. You can reopen setup from the menu bar at any time.
3. Translate
- Select text in any app.
- Press ⌘C twice quickly (within 500 ms).
- The floating panel appears near the mouse. The source app stays frontmost; the panel takes keyboard focus while it is visible so Esc and the shortcuts work immediately. Clicking the source app takes focus back. Clicking anywhere outside the panel closes it; Esc also closes it.
- The translation streams in. Use the language picker to change the target.
- Click Copy to put the translation on the clipboard, or Replace to replace the selection.
- Esc closes the panel. ⌘C copies, ⌘↩ replaces, ⌘R retries and ⌘, opens Settings.
Replace is explicit; nothing is inserted automatically. Replace needs the macOS Accessibility permission. Double copy, translation, Copy and the Services menu work without it.
Mother tongue and language rules
The mother tongue is the default target for every source language. In Settings ▸ General ▸ Translation, you can add language rules that override the default for specific source languages:
Mother tongue: German
Language rules:
Chinese (Simplified) → English
Traditional Chinese → English
German → English
With the table above, Chinese and German text go to English, and every other language goes to German. An empty table means everything goes to the mother tongue.
Rules run in the order shown; a source language appears at most once. Rules apply only when the source is confidently detected; short or mixed text keeps the mother tongue. When a rule applies, the panel header shows the effective direction and a banner offers a one-capture override back to the mother tongue. Choosing a language from the panel picker also overrides the current result only; manage persistent rules in Settings.
4. Services and the menu bar
- Services ▸ Translate with Sprachmittler translates the current selection without polling or Accessibility. You can assign a shortcut under System Settings ▸ Keyboard ▸ Keyboard Shortcuts ▸ Services ▸ Text.
- The menu bar can translate the current clipboard, change the target, copy or replace the last translation, open setup, open diagnostics or quit.
5. Privacy and permissions
- Selected text, translations, prompts and clipboard contents are never logged or written to disk.
- Settings contain only configuration. There is no translation history.
- The default endpoint is loopback. A remote endpoint requires an explicit HTTPS toggle.
- Accessibility is optional and requested only for Replace.
- Input Monitoring, Screen Recording, Camera, Microphone and Apple Events are never requested.
- Diagnostics shows versions, digests, timings and error kinds only — no text.
6. Troubleshooting
| Symptom | Fix |
|---|---|
| “Ollama is not running.” | Start Ollama, then retry. |
| “The Hy-MT3 model is not installed.” | Run the ollama pull command from setup. |
| “Replace needs the Accessibility permission.” | Open System Settings ▸ Privacy & Security ▸ Accessibility and enable Sprachmittler, or use Copy. |
| Replace fails in an app | Use Copy; some Electron/canvas apps do not expose a settable selection. |
| The previous clipboard is not restored | Another app changed the clipboard during the paste; Copy remains available. |
| The panel does not appear | Copy the same text twice within 500 ms; check that the text is non-empty. |
| Translation is cut off | Shorten the selection or retry; the model's documented translation context is 8192 tokens. |
| A number or URL changed | The panel shows a warning; review the text before using it. |
| Slow first translation | The model is loading; warm-up and keep_alive keep it ready. |
7. Uninstall
Quit Sprachmittler, remove Sprachmittler.app from /Applications, and remove its Accessibility
entry in System Settings if present. Ollama and the model are separate and can be removed with
Ollama's own tools.