Translator

Translates localized Payload CMS content into any locale via pluggable providers, with document, bulk-collection, and per-field controls in the admin UI.

Community 16 1.2k/wk MIT v0.10.4

Installation

pnpm add @focus-reactive/payload-plugin-translator

About

Payload localizes content but leaves the actual translation to you, which usually means copying text between locales by hand. This plugin closes that gap. It walks every localized leaf field at any nesting depth (groups, arrays, blocks, tabs, and Lexical rich text), sends the text to a translation provider, and writes the result back to the target locale. Translation is exposed on three surfaces, toggled with the `levels` option: a per-document popup on the edit view, a bulk dashboard on the collection list view, and a per-field control added with `withFieldTranslation`. The default is document and collection levels. The field-level control pulls content into the locale you are editing from a chosen source, writing straight to form state with an undo, and only works on `text`, `textarea`, and `richText` fields (it re-mounts the Lexical editor for rich text). Providers are pluggable through a `TranslationProvider` port, with OpenAI built in. Execution goes through a configurable runner: async Payload Jobs by default, or a synchronous runner. `targetSelection` controls whether one locale or several are translated per run, and strategies let you overwrite everything or skip locales that already have content. An opt-in `withAutoTranslate` wrapper queues translations automatically when a document's source-locale content changes, debouncing rapid edits and skipping saves where nothing translatable changed. Extra options cover an opt-in provenance sidecar collection that records what source state each translation came from, server-side lifecycle callbacks (`onQueued`, `onCompleted`, `onFailed`), an access guard for the endpoints, and a configurable `basePath` (default `/translate`). The plugin requires localization enabled in your Payload config. Field-level translation needs a saved document, and fields inside a localized `blocks` or `array` container cannot be matched by position, so the control no-ops there with a notice to translate the whole document instead. Auto-translate only enqueues jobs, so on serverless platforms like Vercel you need a working job runner or external cron to execute them.

Package info

Package name
@focus-reactive/payload-plugin-translator
Latest version
0.10.4
Unpacked size
691 kB
License
MIT
Weekly downloads
1.2k
Last publish
Aug 21, 2026

More from focusreactive

View profile

Similar plugins

More in AI