Skip to content

scribe 0.3.0

Choose a tag to compare

@lunanoir21 lunanoir21 released this 06 Oct 21:01
· 4 commits to main since this release

Translation, a dictionary, smart actions, and better reading of hard backgrounds.

New: translation (off by default)

  • Switch it on in the settings panel (Translation > Enable translation). A card says what it will do first: the one-time download, what is sent where, memory and disk use. While it is off nothing is downloaded, loaded or sent for translation, and the Translate button does not exist.
  • Translate button under the read region, and in the selection toolbar to translate only the selected words. Optional Translate right after reading.
  • Two views, picked in settings: Card (original and translation side by side, the original is editable and the translation refreshes after you stop typing) and In place (the translation painted over the text, sized to fit, with a bar to switch to the original, copy, or edit).
  • Dictionary: hover a word while a translation is open for its translation and alternatives. Click the bubble to copy.
  • Smart actions: links, e-mail addresses, phone numbers and IBANs found in the text become buttons under the read region, with or without translation (a Smart actions switch under Behaviour, on by default). Links and e-mail open (only http(s) and mailto:, checked again before xdg-open runs), phone numbers and IBANs are copied with one click and scribe closes afterwards like after Copy. IBANs are validated with their mod 97 checksum. In a translation they are kept out of the text. Finding them only runs a small local helper: no model and no network.
  • Offline engine (English ↔ Turkish): CTranslate2 with Argos Translate models in an isolated environment under ~/.local/share/scribe-translate. Installed, reinstalled and removed from the settings panel. The model is loaded when you press Translate and released after two idle minutes, so nothing stays in memory otherwise.
  • Online engine through MyMemory, any language pair. scribe asks before the text leaves your computer: Send once, Always allow or Cancel.
  • New helper translate.py. It takes text on stdin only (never a command line argument) and answers with one line of JSON.
  • New settings keys: translate, autoTranslate, tView, tEngine, tTarget, tSource, tOnline, tEmail, smartActions, dictionary, editable. Everything is validated by config.py like the existing keys.
  • A documentation page on the website, in English and Turkish.

Honesty about quality

  • The settings panel and the card shown before translation is enabled now say that offline translation is a small model and can be wrong (it may take a word for the subject or leave it untranslated), with a real example.
  • A sentence that the reader split into two paragraphs (slightly rotated text) is rejoined before it is translated.
  • A measured Accuracy section on the documentation page: character and word accuracy of the reader for 11 fonts, 9 colour schemes and 3 sizes (792 runs), for images damaged like a photo, for tilted text and for two sample photos, with the weak spots stated plainly (tilted text and strong uneven light). tools/accuracy.py, tools/sample_photos.py and tools/translation_check.py reproduce every number; links, e-mail addresses, phone numbers and IBANs came through translation unchanged 104 times out of 104.

Security

  • The offline pack is pinned: exact package versions installed as wheels only (--only-binary, --isolated), models from one host over HTTPS with a hard size cap and a SHA-256 that must match, archives unpacked only after every entry was checked (no path escape, no unpack bomb).
  • The translation service listens on a socket in $XDG_RUNTIME_DIR (mode 600). Like the screenshot there is no /tmp fallback.
  • SECURITY.md now lists what changes when translation is on: the network requests, the new directory, the service socket and the one extra program the QML starts (xdg-open).
  • New tests (tests/test_translate.py) cover the entity detection, the pinning and verification of downloads, the unpack guards, the stdin rule and the "off means off" guards.

Reading

  • ocr.py reads hard crops (gradients, busy backgrounds, huge or script type, mixed light and dark text) with extra passes at two scales and both polarities, and keeps the fast single pass for plain pages.

Installer

  • install.sh also installs translate.py.