theseus/bundled-addons/translate/addon.json

23 lines
1.6 KiB
JSON
Raw Normal View History

feat(theseus/translate): new sidebar add-on — right-click Translate selection Adds a bundled add-on `translate` with a sidebar panel + a right-click "Translate selection" menu item. Two swappable backends: - LibreTranslate (default) — free MIT engine; the panel's Settings tab lets the user point at any instance (public or self-hosted) and drop in an API key if one's required. - Google (unofficial free endpoint at translate.googleapis.com/ translate_a/single) — no key, wide coverage, but unofficial and Google can break it any time. Opt-in fallback. Flow: user selects text on a page, right-clicks -> "Translate selection". Add-on's context-menu handler stashes the selection under storage.__pending and calls api.revealSidebar("main"); the panel loads, drains __pending on first paint, and translates. Ctrl/Cmd+Enter in the input textarea also translates. Source + target language choices, browser-language default target, swap button, copy-to- clipboard on the output, settings gear. Depends on a new "context-menu-item" capability + api.revealSidebar hook in addons-host.js / main.js. Those wiring changes are prepared but not committed here — a parallel session is refactoring the same functions concurrently, so the safe path is to land translate/ first and let the wiring go in alongside the next host-facing commit. Until the wiring lands, the manifest's "context-menu-item" cap is silently dropped (per validateManifest's unknown-caps policy) and the sidebar panel + the panel's translation UI still work standalone — the right-click entry point is what's gated.
2026-09-20 17:50:06 +02:00
{
"id": "translate",
"name": "Translate",
translate 0.1.2 → 0.1.3: real icon, bigger text, zoom, auto-translate on language change Auto-translate: changing either language only called saveUi(), so the pane below kept showing the previous language's result with nothing to say it was stale — you had to notice and press Translate. Both selects now re-run the translation, guarded on empty input and on source === target (which would only echo the input back). Text size: the panes were 13.5px, small for reading a paragraph in a language you don't know well, which is the entire job. Base is now 15px, driven by a --tsize custom property so both panes stay matched. Zoom: −/+ either side of a percentage in the header, 70–220% in steps of 10, clamped with the buttons disabling at each end. Click the percentage to reset. Ctrl/Cmd with +, - or 0 does the same from either pane. Persists per-machine alongside the language choice. Icon: a globe with an A tile and a 文 tile, replacing the 🌐 emoji that was indistinguishable from every other globe in the dock. Drawn against the 16px and 18px rasterizations rather than at a comfortable size — the first pass used a font glyph for 文 and it turned to grey mush at 16px, so the strokes are hand-drawn paths thick enough to survive. Also drops the hardcoded icon in registerSidebarPanel, which would otherwise shadow the manifest's mark. Verified in a harness with a stubbed host API: language change fires exactly one request, the two guards fire none, zoom clamps and persists, and the layout holds at sidebar width.
2026-09-27 18:00:46 +02:00
"version": "0.1.3",
feat(theseus/translate): new sidebar add-on — right-click Translate selection Adds a bundled add-on `translate` with a sidebar panel + a right-click "Translate selection" menu item. Two swappable backends: - LibreTranslate (default) — free MIT engine; the panel's Settings tab lets the user point at any instance (public or self-hosted) and drop in an API key if one's required. - Google (unofficial free endpoint at translate.googleapis.com/ translate_a/single) — no key, wide coverage, but unofficial and Google can break it any time. Opt-in fallback. Flow: user selects text on a page, right-clicks -> "Translate selection". Add-on's context-menu handler stashes the selection under storage.__pending and calls api.revealSidebar("main"); the panel loads, drains __pending on first paint, and translates. Ctrl/Cmd+Enter in the input textarea also translates. Source + target language choices, browser-language default target, swap button, copy-to- clipboard on the output, settings gear. Depends on a new "context-menu-item" capability + api.revealSidebar hook in addons-host.js / main.js. Those wiring changes are prepared but not committed here — a parallel session is refactoring the same functions concurrently, so the safe path is to land translate/ first and let the wiring go in alongside the next host-facing commit. Until the wiring lands, the manifest's "context-menu-item" cap is silently dropped (per validateManifest's unknown-caps policy) and the sidebar panel + the panel's translation UI still work standalone — the right-click entry point is what's gated.
2026-09-20 17:50:06 +02:00
"description": "Right-click a selection to translate it. Sidebar panel with LibreTranslate or Google as the backend.",
"author": "Silent Mode",
translate 0.1.2 → 0.1.3: real icon, bigger text, zoom, auto-translate on language change Auto-translate: changing either language only called saveUi(), so the pane below kept showing the previous language's result with nothing to say it was stale — you had to notice and press Translate. Both selects now re-run the translation, guarded on empty input and on source === target (which would only echo the input back). Text size: the panes were 13.5px, small for reading a paragraph in a language you don't know well, which is the entire job. Base is now 15px, driven by a --tsize custom property so both panes stay matched. Zoom: −/+ either side of a percentage in the header, 70–220% in steps of 10, clamped with the buttons disabling at each end. Click the percentage to reset. Ctrl/Cmd with +, - or 0 does the same from either pane. Persists per-machine alongside the language choice. Icon: a globe with an A tile and a 文 tile, replacing the 🌐 emoji that was indistinguishable from every other globe in the dock. Drawn against the 16px and 18px rasterizations rather than at a comfortable size — the first pass used a font glyph for 文 and it turned to grey mush at 16px, so the strokes are hand-drawn paths thick enough to survive. Also drops the hardcoded icon in registerSidebarPanel, which would otherwise shadow the manifest's mark. Verified in a harness with a stubbed host API: language change fires exactly one request, the two guards fire none, zoom clamps and persists, and the layout holds at sidebar width.
2026-09-27 18:00:46 +02:00
"icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij4gPGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTEiIGZpbGw9IiMxZDRlZDgiLz4gPGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEuMSIgb3BhY2l0eT0iLjQ1Ij48ZWxsaXBzZSBjeD0iMTIiIGN5PSIxMiIgcng9IjQuNiIgcnk9IjExIi8+PC9nPiA8cmVjdCB4PSIwLjYiIHk9IjEuOCIgd2lkdGg9IjExLjYiIGhlaWdodD0iMTEuNiIgcng9IjIuNiIgZmlsbD0iI2ZmZiIvPiA8dGV4dCB4PSI2LjQiIHk9IjExLjEiIHRleHQtYW5jaG9yPSJtaWRkbGUiIGZvbnQtZmFtaWx5PSJzeXN0ZW0tdWksU2Vnb2UgVUksc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxMCIgZm9udC13ZWlnaHQ9IjgwMCIgZmlsbD0iIzFkNGVkOCI+QTwvdGV4dD4gPHJlY3QgeD0iMTEuOCIgeT0iMTAuNiIgd2lkdGg9IjExLjYiIGhlaWdodD0iMTEuNiIgcng9IjIuNiIgZmlsbD0iIzBiMTIyMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEiLz4gPGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjEuOSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBmaWxsPSJub25lIj4gPHBhdGggZD0iTTE3LjYgMTIuNXYxIi8+IDxwYXRoIGQ9Ik0xNC40IDE0LjdoNi40Ii8+IDxwYXRoIGQ9Ik0xOC4zIDE1LjYgMTQuNyAyMCIvPiA8cGF0aCBkPSJNMTYuOSAxNS42IDIwLjUgMjAiLz4gPC9nPiA8L3N2Zz4=",
feat(theseus/translate): new sidebar add-on — right-click Translate selection Adds a bundled add-on `translate` with a sidebar panel + a right-click "Translate selection" menu item. Two swappable backends: - LibreTranslate (default) — free MIT engine; the panel's Settings tab lets the user point at any instance (public or self-hosted) and drop in an API key if one's required. - Google (unofficial free endpoint at translate.googleapis.com/ translate_a/single) — no key, wide coverage, but unofficial and Google can break it any time. Opt-in fallback. Flow: user selects text on a page, right-clicks -> "Translate selection". Add-on's context-menu handler stashes the selection under storage.__pending and calls api.revealSidebar("main"); the panel loads, drains __pending on first paint, and translates. Ctrl/Cmd+Enter in the input textarea also translates. Source + target language choices, browser-language default target, swap button, copy-to- clipboard on the output, settings gear. Depends on a new "context-menu-item" capability + api.revealSidebar hook in addons-host.js / main.js. Those wiring changes are prepared but not committed here — a parallel session is refactoring the same functions concurrently, so the safe path is to land translate/ first and let the wiring go in alongside the next host-facing commit. Until the wiring lands, the manifest's "context-menu-item" cap is silently dropped (per validateManifest's unknown-caps policy) and the sidebar panel + the panel's translation UI still work standalone — the right-click entry point is what's gated.
2026-09-20 17:50:06 +02:00
"main": "index.js",
translate 0.1.2 → 0.1.3: real icon, bigger text, zoom, auto-translate on language change Auto-translate: changing either language only called saveUi(), so the pane below kept showing the previous language's result with nothing to say it was stale — you had to notice and press Translate. Both selects now re-run the translation, guarded on empty input and on source === target (which would only echo the input back). Text size: the panes were 13.5px, small for reading a paragraph in a language you don't know well, which is the entire job. Base is now 15px, driven by a --tsize custom property so both panes stay matched. Zoom: −/+ either side of a percentage in the header, 70–220% in steps of 10, clamped with the buttons disabling at each end. Click the percentage to reset. Ctrl/Cmd with +, - or 0 does the same from either pane. Persists per-machine alongside the language choice. Icon: a globe with an A tile and a 文 tile, replacing the 🌐 emoji that was indistinguishable from every other globe in the dock. Drawn against the 16px and 18px rasterizations rather than at a comfortable size — the first pass used a font glyph for 文 and it turned to grey mush at 16px, so the strokes are hand-drawn paths thick enough to survive. Also drops the hardcoded icon in registerSidebarPanel, which would otherwise shadow the manifest's mark. Verified in a harness with a stubbed host API: language change fires exactly one request, the two guards fire none, zoom clamps and persists, and the layout holds at sidebar width.
2026-09-27 18:00:46 +02:00
"capabilities": [
"sidebar-panel",
"context-menu-item"
],
feat(theseus/translate): new sidebar add-on — right-click Translate selection Adds a bundled add-on `translate` with a sidebar panel + a right-click "Translate selection" menu item. Two swappable backends: - LibreTranslate (default) — free MIT engine; the panel's Settings tab lets the user point at any instance (public or self-hosted) and drop in an API key if one's required. - Google (unofficial free endpoint at translate.googleapis.com/ translate_a/single) — no key, wide coverage, but unofficial and Google can break it any time. Opt-in fallback. Flow: user selects text on a page, right-clicks -> "Translate selection". Add-on's context-menu handler stashes the selection under storage.__pending and calls api.revealSidebar("main"); the panel loads, drains __pending on first paint, and translates. Ctrl/Cmd+Enter in the input textarea also translates. Source + target language choices, browser-language default target, swap button, copy-to- clipboard on the output, settings gear. Depends on a new "context-menu-item" capability + api.revealSidebar hook in addons-host.js / main.js. Those wiring changes are prepared but not committed here — a parallel session is refactoring the same functions concurrently, so the safe path is to land translate/ first and let the wiring go in alongside the next host-facing commit. Until the wiring lands, the manifest's "context-menu-item" cap is silently dropped (per validateManifest's unknown-caps policy) and the sidebar panel + the panel's translation UI still work standalone — the right-click entry point is what's gated.
2026-09-20 17:50:06 +02:00
"context-menu-items": [
{
"id": "translate-selection",
"label": "Translate selection",
"when": "selectionText",
"icon": "🌐"
}
],
"updateURL": "https://navigate.st/bns/theseus.x/extensions/translate/updates.json"
}