by Seigwen Lee
Translate selections and whole notes with Google or your own AI model (20+ BYOK providers).
Updated todayMIT
DualTran for Obsidian
Translate selections and whole notes inside Obsidian with Google or your
own AI model (BYOK, 20+ providers) — powered by @dualtran/core, the engine
extracted from the DualTran browser extension.
Commands
- Translate selection (replace) — replaces the selection with the translation.
- Translate selection (insert below) — keeps the original and inserts the translation right below it.
- Translate note to a new file — translates the whole note into a new file next to the original.
Development
node scripts/sync-core.mjs # builds + vendors @dualtran/core (CORE_REPO env to override)
npm install # installs devDeps + the vendored tarball
npm test # unit + integration suites
npm run build # produces main.js (production, minified)
npm run verify # test + build + dist guards (manifest/versions/size/node-refs)
npm run dev builds with inline source maps and watches (main.js).
Architecture
src/bridge.ts— host-agnostic translation logic (Google batch viacore.translateGoogle, AI viacore.streamChat); fully dependency-injected.src/coreAdapter.ts— the only module that imports the vendored core.src/editorOps.ts— pure editor-insertion helpers (ObsidianEditor-shaped).src/settings.ts— settings shape, defaults and sanitization.src/main.ts— plugin wiring: commands, settings tab,requestUrl-based fetch adapter (no CORS on desktop or mobile).
Releasing
- Bump
manifest.json+package.json+versions.json(minAppVersion map). npm run verifygreen.- Commit, tag without a
vprefix matching the manifest version exactly, push the tag, then attachmain.js,manifest.jsonandstyles.css(if any) to the GitHub release. - Submit via community.obsidian.md (see docs/SUBMISSION.md in the repo — added with the submission materials).
License
MIT — the bundled @dualtran/core portion is MPL-2.0.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.