Skip to content

docs(translator): rewrite the README around the plugin's interface - #143

Merged
SearheiParkhamchuk merged 3 commits into
mainfrom
docs/translator-readme
Sep 15, 2026
Merged

SearheiParkhamchuk merged 3 commits into
mainfrom
docs/translator-readme

Conversation

@SearheiParkhamchuk

Copy link
Copy Markdown
Contributor

Rewrites the translator README. It had grown to 5812 words, much of it describing how the plugin is built rather than how to use it, and several of its claims had stopped being true.

What changed

Shape. The page now opens with what the plugin does, a quickstart that runs as written, and a list of capabilities — then the reference below a table of contents. 5812 → 4461 words.

Only what a reader sees or controls. Mechanism was dropped wherever it changed neither observable behaviour nor a setting: how fields are walked, how results are written back, how jobs are drained, how the transaction is scoped. What stayed is behaviour and parameters.

Corrections

Each of these was in the old README and is wrong:

Claim Reality
"Every public API carries an @since" 22 of 53 exports have no tag — the convention starts at 0.5.0 and is not backfilled
Job-pruning recipe filtering taskSlug The runner has queued a workflow since 0.11.4, so Payload sets workflowSlug and leaves taskSlug unset — the query matched nothing, silently
Drafts and publishing, stated unconditionally Only holds with versions.drafts on; without drafts the translation goes straight to the live document and publish-on-translation is a silent no-op
"Pin the model" under openAIComplete model is required there; the default belongs to the deprecated createOpenAIProvider
"Block and array ids survive" Not inside a localized container, where each locale owns its rows
retries has no default It is { attempts: 3, backoff: { type: 'exponential', delay: 5000 } }
react ^18 Does not install: current @payloadcms/ui and @payloadcms/richtext-lexical require react 19
Error mentioning response_format That string is not in any message the plugin throws
"The only way to trigger a translation without the admin UI" POST /field and auto-translate also do

Additions

  • capabilities.inlineMarks — container mode is silently ignored unless the provider declares it, and the recommended createTranslationProvider + openAIComplete recipe did not. Without this the feature could not be switched on by following the docs.
  • Auto-translate publishes what it writes, with no setting to hold it back — relevant to anyone expecting to review translations first.
  • createSyncRunner takes options (maxSize, ttlMs) and forgets task status on restart.
  • A table of contents (npm renders no outline of its own), the terms 0.x is released under, and Since vX.Y.Z notes on every feature that carries an @since.

Removed

The job-history section: the recipe did nothing, and maintaining Payload's jobs table is not this plugin's interface. The fact that Payload deletes jobs on completion is kept, since it explains why the panels never show "Completed".

Verification

  • All 12 TypeScript samples compile with real tsc against the published 0.13.2 tarball and its peers — not the working copy.
  • Every option, default and error code checked against source; the suite (1514 tests) is green.
  • Links, anchors, table of contents and code fences checked programmatically.

Not in this PR

Three things surfaced while auditing, each its own change:

  1. The published ESM entry re-exports with extensionless specifiers (from "./plugin"), so plain Node cannot import the package — ERR_MODULE_NOT_FOUND, though bundlers resolve it. It bites anyone writing a standalone script.
  2. DryRunConfig is exported but its transform field's type is not, so the type cannot be written in full by a consumer. Both die with the deprecation.
  3. apps/dev/src/app/(payload)/admin/importMap.js is dirty in the working tree with unrelated analytics entries removed; left untouched deliberately.

The second commit turns on multi-target selection in the dev sandbox.

Cut it from 5812 to 4461 words by describing what a reader sees and
controls, and dropping how the plugin is built where that changes
neither.

Corrected what was false:
- "every public API carries @SInCE" — 22 of 53 exports have no tag
- the job-pruning recipe filtered taskSlug, which the runner has not set
  since 0.11.4; the query matched nothing
- drafts-and-publishing read as universal; without drafts a translation
  goes straight to the live document and publish-on-translation is a
  silent no-op
- "pin the model" sat on openAIComplete, where model is required
- block and array ids do not survive inside a localized container
- retries has a default; the table said it had none
- react ^18 does not install against current @payloadcms/ui

Added what was missing:
- how to declare capabilities.inlineMarks, without which container mode
  silently does nothing
- auto-translate publishes what it writes, with no way to hold it back
- createSyncRunner takes options and forgets its status on restart

Also: a table of contents, the terms 0.x is released under, and Since
notes on every feature that carries an @SInCE.
@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ideal-cms Ready Ready Preview Sep 15, 2026 3:57pm UTC

Request Review

@SearheiParkhamchuk
SearheiParkhamchuk merged commit 02af0d3 into main Sep 15, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.13.3 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant