Translates content from a source locale into target locales in the background whenever documents are created or updated. It keeps the Lexical rich text structure intact and can generate localized SEO slugs. It requires Payload 3.x, PostgreSQL via the Postgres adapter and a LibreTranslate server. A standalone CLI crawler backfills existing PostgreSQL data.
High-performance auto-translation plugin for Payload CMS 3.x with LibreTranslate, Lexical Rich Text AST compression, debounced background worker queue, SEO slugification, and direct PostgreSQL bulk crawler.
Installation
npm i @itpyx/payload-auto-translate2
Stars
0
Forks
0
Open Issues
1 months ago
Last Updated
48
Weekly Downloads
v1.3.3
npm Version
428.3 KB
Unpacked Size
2
Dependencies
2+2 since Oct 4
| Date | Stars |
|---|---|
| Dec 6, 2026 | 2 |
| Dec 5, 2026 | 2 |
| Dec 4, 2026 | 2 |
| Dec 3, 2026 | 2 |
| Dec 2, 2026 | 2 |
| Dec 1, 2026 | 2 |
| Nov 30, 2026 | 2 |
| Nov 29, 2026 | 2 |
| Nov 28, 2026 | 2 |
| Nov 27, 2026 | 2 |
| Nov 26, 2026 | 2 |
| Nov 25, 2026 | 2 |
| Nov 24, 2026 | 2 |
| Nov 23, 2026 | 2 |
| Nov 22, 2026 | 2 |
| Nov 21, 2026 | 2 |
| Nov 20, 2026 | 2 |
| Nov 19, 2026 | 2 |
| Nov 18, 2026 | 2 |
| Nov 17, 2026 | 2 |
| Nov 16, 2026 | 2 |
| Nov 15, 2026 | 2 |
| Nov 14, 2026 | 2 |
| Nov 13, 2026 | 2 |
| Nov 12, 2026 | 2 |
| Nov 11, 2026 | 2 |
| Nov 10, 2026 | 2 |
| Nov 9, 2026 | 2 |
| Nov 8, 2026 | 2 |
| Nov 7, 2026 | 2 |
| Nov 6, 2026 | 2 |
| Nov 5, 2026 | 2 |
| Nov 4, 2026 | 2 |
| Nov 3, 2026 | 2 |
| Nov 2, 2026 | 2 |
| Nov 1, 2026 | 2 |
| Oct 31, 2026 | 2 |
| Oct 30, 2026 | 2 |
| Oct 29, 2026 | 2 |
| Oct 28, 2026 | 2 |
| Oct 27, 2026 | 2 |
| Oct 26, 2026 | 2 |
| Oct 25, 2026 | 2 |
| Oct 24, 2026 | 2 |
| Oct 23, 2026 | 2 |
| Oct 22, 2026 | 2 |
| Oct 21, 2026 | 2 |
| Oct 20, 2026 | 2 |
| Oct 19, 2026 | 2 |
| Oct 18, 2026 | 2 |
| Oct 17, 2026 | 2 |
| Oct 16, 2026 | 2 |
| Oct 15, 2026 | 2 |
| Oct 14, 2026 | 2 |
| Oct 13, 2026 | 2 |
| Oct 12, 2026 | 2 |
| Oct 11, 2026 | 2 |
| Oct 10, 2026 | 2 |
| Oct 9, 2026 | 2 |
| Oct 8, 2026 | 2 |
| Oct 7, 2026 | 2 |
| Oct 6, 2026 | 2 |
| Oct 5, 2026 | 2 |
| Oct 4, 2026 | 0 |
42−260 since Oct 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 42 |
| Dec 5, 2026 | 40 |
| Dec 4, 2026 | 44 |
| Dec 3, 2026 | 62 |
| Dec 2, 2026 | 60 |
| Dec 1, 2026 | 47 |
| Nov 30, 2026 | 42 |
| Nov 29, 2026 | 38 |
| Nov 28, 2026 | 38 |
| Nov 27, 2026 | 51 |
| Nov 26, 2026 | 47 |
| Nov 25, 2026 | 55 |
| Nov 24, 2026 | 64 |
| Nov 23, 2026 | 67 |
| Nov 22, 2026 | 68 |
| Nov 21, 2026 | 84 |
| Nov 20, 2026 | 88 |
| Nov 19, 2026 | 87 |
| Nov 18, 2026 | 109 |
| Nov 17, 2026 | 156 |
| Nov 16, 2026 | 182 |
| Nov 15, 2026 | 206 |
| Nov 14, 2026 | 242 |
| Nov 13, 2026 | 826 |
| Nov 12, 2026 | 831 |
| Nov 11, 2026 | 806 |
| Nov 10, 2026 | 772 |
| Nov 9, 2026 | 749 |
| Nov 8, 2026 | 752 |
| Nov 7, 2026 | 1,006 |
| Nov 6, 2026 | 400 |
| Nov 5, 2026 | 383 |
| Nov 4, 2026 | 374 |
| Nov 3, 2026 | 358 |
| Nov 2, 2026 | 355 |
| Nov 1, 2026 | 331 |
| Oct 31, 2026 | 38 |
| Oct 30, 2026 | 45 |
| Oct 29, 2026 | 43 |
| Oct 28, 2026 | 42 |
| Oct 27, 2026 | 47 |
| Oct 26, 2026 | 55 |
| Oct 25, 2026 | 60 |
| Oct 24, 2026 | 73 |
| Oct 23, 2026 | 66 |
| Oct 22, 2026 | 74 |
| Oct 21, 2026 | 95 |
| Oct 20, 2026 | 96 |
| Oct 19, 2026 | 121 |
| Oct 18, 2026 | 277 |
| Oct 17, 2026 | 272 |
| Oct 16, 2026 | 336 |
| Oct 15, 2026 | 638 |
| Oct 14, 2026 | 975 |
| Oct 13, 2026 | 1,263 |
| Oct 12, 2026 | 1,225 |
| Oct 11, 2026 | 1,058 |
| Oct 10, 2026 | 1,034 |
| Oct 9, 2026 | 970 |
| Oct 8, 2026 | 660 |
| Oct 7, 2026 | 302 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1404441092-root)<a href="https://payloaddirectory.dev/plugins/1404441092-root"><img src="https://payloaddirectory.dev/badge/1404441092-root.svg" alt="Payload Directory"></a>README
High-performance automated multi-language translation plugin for Payload CMS 3.x
Real-time background sync, Lexical Rich Text AST preservation, SEO slugification, and high-speed PostgreSQL bulk database crawler powered by LibreTranslate.
Payload CMS provides an excellent schema localization engine (localized: true), but it does not translate content out of the box—editors typically have to duplicate and translate content by hand.
@itpyx/payload-auto-translate automates the entire localization lifecycle:
inverter-split-ac -> climatiseur-split-inverter in French, aire-acondicionado-split-inverter in Spanish) with German umlaut expansion and non-Latin character safety.blockTypes.📖 Full Guide: For a complete walkthrough of configuring environment variables, Next.js transpilation, CLI backfill, and production Docker setups, see the Comprehensive Integration Guide.
^3.0.0@payloadcms/db-postgres)>=18.20.0 or >=20.9.0pnpm add @itpyx/payload-auto-translate pg dotenv
# or
npm install @itpyx/payload-auto-translate pg dotenv
# or
yarn add @itpyx/payload-auto-translate pg dotenv
payload.config.tsimport { buildConfig } from 'payload'
import { postgresAdapter } from '@payloadcms/db-postgres'
import { autoTranslatePlugin } from '@itpyx/payload-auto-translate'
export default buildConfig({
localization: {
locales: [
{ label: 'English', code: 'en' },
{ label: 'Español', code: 'es' },
{ label: 'Français', code: 'fr' },
{ label: 'Deutsch', code: 'de' },
{ label: 'العربية', code: 'ar' },
{ label: '日本語', code: 'ja' },
],
defaultLocale: 'en',
fallback: true,
},
db: postgresAdapter({
pool: { connectionString: process.env.DATABASE_URL },
}),
plugins: [
autoTranslatePlugin({
engine: {
url: process.env.LIBRETRANSLATE_URL || 'http://127.0.0.1:5000',
apiKey: process.env.LIBRETRANSLATE_API_KEY,
},
sourceLocale: 'en',
targetLocales: ['es', 'fr', 'de', 'ar', 'ja'],
activeTranslation: {
enabled: true,
concurrency: 2,
triggerOn: ['create', 'update'],
translateDrafts: true, // Preserves draft status in collections with versions
},
// Optional: Automatic SEO slug translation
slug: {
enabled: true, // Enable automatic translated slugs
latinLocalesOnly: true // Preserves clean ASCII slugs for non-Latin (ar, ja)
},
// Optional: Configure specific collections
collections: {
pages: true,
blog: {
translateSlug: true,
excludedFields: ['authorNotes', 'internalReview'],
},
},
}),
],
})
Add to your .env:
LIBRETRANSLATE_URL=http://your-vps-ip:5000
LIBRETRANSLATE_API_KEY=your_optional_api_key
If your CMS runs within Next.js, add the package to transpilePackages in next.config.mjs:
/** @type {import('next').NextConfig} */
const nextConfig = {
transpilePackages: ['@itpyx/payload-auto-translate'],
}
export default nextConfig
autoTranslatePlugin(options)| Option | Type | Default | Description |
|---|---|---|---|
engine.url | string | process.env.LIBRETRANSLATE_URL || 'http://127.0.0.1:5000' | Base URL of your LibreTranslate instance. |
engine.apiKey | string | process.env.LIBRETRANSLATE_API_KEY | Optional API key if your LibreTranslate server requires authentication. |
sourceLocale | string | Payload defaultLocale || 'en' | The master locale from which translations are generated. |
targetLocales | string[] | All other configured locales | Array of target language codes to translate into. |
activeTranslation.enabled | boolean | true | Enables real-time background translation on editorial save. |
activeTranslation.concurrency | number | 2 | Number of concurrent documents processed in the queue. |
activeTranslation.triggerOn | ('create' | 'update')[] | ['create', 'update'] | Operations that trigger background translation. |
activeTranslation.translateDrafts | boolean | true | Translates drafts without prematurely publishing them. |
slug.enabled | boolean | false | Enable automatic SEO slug generation for localized documents. |
slug.latinLocalesOnly | boolean | true | If true, only translates slugs for Latin locales (es, fr, de, it, pt) and preserves ASCII slugs for non-Latin (ar, ru, ja). |
slug.sourceField | string | 'title' | Field to derive slug from (falls back to 'name'). |
slug.slugify | function | Built-in SEO slugifier | Custom function: (title, locale, currentSlug) => string. |
customFieldExclusions | string[] | [] | Field names to exclude from translation globally. |
customValueExclusions | string[] | [] | Specific text strings to skip during translation globally. |
customValuePatterns | (string | RegExp)[] | [] | Custom regex patterns or strings to skip during translation (e.g. hardware specs like [/^IP\d+/, /^RS-?485/i]). |
fallbackRetry | FallbackRetryOptions | { enabled: false } | Optional fallback retry for strings returning untranslated (e.g., Title Cased headlines). |
collections | Record<string, boolean | CollectionConfigOptions> | Auto-detected | Selectively enable, exclude fields, or toggle slug translation per collection. |
globals | Record<string, boolean | CollectionConfigOptions> | Auto-detected | Selectively enable or exclude fields per global. |
disabled | boolean | false | Master kill-switch to temporarily disable the plugin. |
When slug.enabled: true is set (or translateSlug: true on a specific collection):
ä -> ae, ö -> oe, ü -> ue, ß -> ss (e.g. Lüftungstechnik Köln -> lueftungstechnik-koeln).Climatisation Écologique -> climatisation-ecologique).latinLocalesOnly: true (default), non-Latin languages (ar, ja, ru, zh) safely preserve the base ASCII slug, avoiding broken percent-encoded URLs (%D8%A7%D9%84%D...). When set to false, clean Unicode characters are preserved.For initial migrations, importing large catalogs, or translating existing records, use the standalone Database Crawler. It connects directly to PostgreSQL via raw SQL, inspects all tables with a _locale column, and populates missing target rows in high-speed parallel batches.
# 1. Dry run (inspect translatable tables and strings without writing to the database):
pnpm payload-auto-translate
# 2. Live migration (writes translated records directly to PostgreSQL):
pnpm payload-auto-translate --live
# 3. Limit translation to specific tables:
pnpm payload-auto-translate --live --tables=pages,products
# 4. Enable fallback retry for Title Case / Headline echoes:
pnpm payload-auto-translate --live --fallback-retry --fallback-strategy=sentence-case
# 5. Skip domain-specific tokens or hardware specs via patterns:
pnpm payload-auto-translate --live --value-patterns="/^IP\d+$/i,/^RS-?485$/i"
# 6. Custom .env file path:
pnpm payload-auto-translate --live --env=/path/to/.env
Add helper scripts to your CMS package.json:
{
"scripts": {
"translate:dry": "payload-auto-translate",
"translate:bulk": "payload-auto-translate --live"
}
}
The plugin exposes secure, authenticated endpoints under your Payload API router:
GET /api/auto-translate/status: Returns LibreTranslate connectivity, supported language codes, active queue stats, and bulk crawler progress.POST /api/auto-translate/start-bulk: Asynchronously triggers a bulk migration across all localized tables.GET /api/auto-translate/bulk-progress: Polls live migration progress (tables processed, total strings, translated strings, inserted/updated counts).To run your own free, unlimited translation instance on your server using Docker:
docker run -d \
--name libretranslate \
-p 5000:5000 \
--restart unless-stopped \
libretranslate/libretranslate:latest \
--load-only en,es,fr,de,ar,pt,ru,ja
MIT License. Copyright (c) 2026 IT-PYX.
translator
Translate localized Payload content from the admin or Local API using Google, OpenAI, LibreTranslate or custom resolvers
541.5k/wk335v3
payload plugin translator
AI translation of localized fields in collections and globals, saved as drafts without overwriting hand-edited text
74356/wk1v3
payload plugin translator
Translate localized Payload content with an AI provider from the admin panel via background jobs
713.9k/wk37v3
payload plugin polyglot
Automatic content translation on publish and in sweeps, with translation memory and protection for human-reviewed text
68836/wk0v3
payload plugin ai localization
Auto-translate localized fields from the default locale using OpenAI from the Payload admin
4334/wk26v3
payload crowdin sync
Sync localized Payload fields to Crowdin as compact HTML and JSON files and write translations back
2614v3