From 93e54ca3483cd864ed72e32e353cac63a3e2c067 Mon Sep 17 00:00:00 2001 From: Local Dev Date: Thu, 22 Oct 2026 15:59:09 +0300 Subject: [PATCH] translate 0.1.6 -> 0.1.7: translate as you type, and say what was detected Typing never triggered a translation. The input handler was wired only to the language detector, so nothing happened until Enter, the Translate button or a language change -- the panel looked broken to anyone who simply typed and waited. Translation now runs 500 ms after the text settles. Each request carries a sequence number. Typing outruns the network, and without that guard a slower earlier response paints its stale text over a newer one. Detection already worked, but wrote its answer only into the text of the collapsed "Auto-detect" option, which a closed select hides -- so it read as "detection is broken" when it had in fact succeeded. Name the language in a row under the selects, and lower the 12-character floor to 5, since short phrases never cleared it. With translate-as-you-type on, skip the standalone detect call: the translation response already carries the detected language, so asking twice only doubled the load on a public mirror. Two of the three fallback mirrors were dead, checked by posting to both endpoints: translate.plausibility.cloud answers 405, and lingva.ml serves an HTML page because it is not a LibreTranslate API at all, so it could only ever produce the "HTML instead of JSON" failure. Drop both and add silentmode.st/libre, which stays a fallback rather than the default because it covers six languages against disroot's fifty. Auto-translate sends text to a translation server as it is typed, so it is a visible toggle rather than silent behaviour. Default on. --- PENDING.md | 30 +++++++ bundled-addons/translate/addon.json | 10 ++- bundled-addons/translate/index.js | 13 ++- bundled-addons/translate/panel.html | 128 ++++++++++++++++++++++++---- 4 files changed, 161 insertions(+), 20 deletions(-) diff --git a/PENDING.md b/PENDING.md index fe7fbce8..b8bb88a2 100644 --- a/PENDING.md +++ b/PENDING.md @@ -16,6 +16,36 @@ Releases are no longer recorded here: the live version and hashes are in `../site/releases-manifest.json` and `https://dl.silentmode.st/releases-manifest.json`, and each release commit is `Theseus 0.3.x: ...` in git history. +## session: `2026-10-22:translate-auto` + +translate 0.1.6 → **0.1.7**. **PUBLISHED 2026-10-22** to the extension OTA +channel (`bns/theseus/extensions/translate/`), no Theseus release needed — +but the source is **still uncommitted**, so git does not yet contain the code +that is live. Commit before anyone rebuilds from this tree. + +- [bundled-addons/translate/panel.html](bundled-addons/translate/panel.html) — + translate-as-you-type (500 ms debounce, sequence-guarded so a slow earlier + request cannot paint over a newer one), a visible "Detected: German" row + under the selects, `DETECT_MIN_CHARS` 12 → 5, a "Translate as I type" toggle + (default on, persisted in `ui`). +- [bundled-addons/translate/index.js](bundled-addons/translate/index.js) — + fallback mirrors corrected: dropped `translate.plausibility.cloud` (405) and + `lingva.ml` (serves HTML; it is not a LibreTranslate API), added + `silentmode.st/libre`. + +**Why:** typing never triggered a translation at all — only Enter, the button +or a language change did. Detection *did* work, but was written only into the +text of the collapsed `