Multilang

Polylang-style document localization for Payload CMS where each translation is its own document.

Community 0 1.3k/wk MIT v0.0.12

Installation

pnpm add @roxxel/payload-multilang

About

This plugin gives Payload CMS a translation model where each language version of a document is a separate Payload document, linked together by hidden metadata fields. It is an alternative to Payload's built-in field-level localization, and the two cannot run together: the plugin throws during config setup if `config.localization` is enabled, so you keep `localization: false` and put translated text directly on each language document. You enable collections and globals in `payload.config.ts` and define a `languages` array with code, name, locale, flag label, RTL/LTR direction, and a single default. Translated collections get hidden `_multilangLanguage`, `_multilangGroup`, and `_multilangMeta` fields (names are overridable). The admin panel gains a language selector in the document sidebar, a `Translations` edit view for creating and connecting translations, translation status per language, and a language filter plus shortcut columns in the collection list. Localized globals render one tab per configured language. Per-collection options control translation behavior. `synchronizedFields` keeps top-level fields such as author or featured image identical across all translations in a group, updating the linked documents when one changes. `duplicate` (default true) copies compatible source fields into a new translation, and `duplicateExcludeFields` skips specific fields during that copy. The plugin also adds custom endpoints to each translated collection for translation actions. Helper APIs cover the common app needs: `withLanguage` filters Local API queries by language, `getDocumentTranslationsWithPayload` and `getDocumentTranslationWithPayload` fetch a translation group or one language version with request-scoped access control, `findGlobalByLanguageWithPayload` and `updateGlobalByLanguageWithPayload` read and write a single language of a global without touching the others, and `localizedSlugQuery` plus `getMultilangDocumentLanguage` support frontend routing and admin preview URLs. Because translations are independent documents, slug uniqueness needs attention: global `unique: true` works only when every language has a distinct slug, otherwise you scope uniqueness to language plus slug. The plugin targets Payload 3.x (peer dependency `payload ^3.84.1`) and ships TypeScript types, React admin components, and a Next.js based dev app.

Package info

Package name
@roxxel/payload-multilang
Latest version
0.0.12
Unpacked size
723 kB
License
MIT
Weekly downloads
1.3k
Last publish
Jul 5, 2026

Similar plugins

More in Content