Translate Block
- from @localmode
- by LocalMode
Translate across 24 directed offline Opus-MT language pairs (English-centric, every model id verified) with swap-direction that carries the output into the input, per-panel character counts, copy-with-confirmation, and cancel. Resolves the Chrome Translator API when available (zero download) and automatically falls back to the pair's Opus-MT Transformers.js model behind an explicit download gate, with a truthful provider badge. No model bytes download until an explicit in-block action.
Install
New to shadcn? Set up your project
If your project already has a shadcn components.json, skip initialization. Otherwise, run this once from your project root.
pnpm dlx shadcn@latest initpnpm dlx shadcn@latest add @localmode/ui/blocks/writing-tools/translateRegistry dependencies6
- @localmode/ui/input-controls/copy-button
- @localmode/ui/input-controls/language-pair-selector
- @localmode/ui/lib/utils
- @localmode/ui/local-first/chrome-ai-download-gate
- @localmode/ui/local-first/provider-badge
- @localmode/ui/results/error-alert
