Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 1.68 KB

File metadata and controls

61 lines (47 loc) · 1.68 KB

payload-crowdin-sync

Sync localized fields from Payload CMS to Crowdin and back.

  • Upload source content from your source locale to Crowdin whenever you save/publish.
  • Keep translated locales read-only in Payload.
  • Pull translations back from Crowdin into Payload via UI actions (or endpoints/jobs).

Requirements

  • Payload: v3+
  • Crowdin: project + API token
  • Node: see engines in plugin/package.json

Install

npm install payload-crowdin-sync

Quick start

import { buildConfig } from 'payload'
import { crowdinSync } from 'payload-crowdin-sync'

export default buildConfig({
  plugins: [
    crowdinSync({
      projectId: 323731,
      directoryId: 1169, // optional: Crowdin folder to store sources
      token: process.env.CROWDIN_TOKEN ?? '',
      organization: process.env.CROWDIN_ORGANIZATION ?? '',
      sourceLocale: 'en',
      localeMap: {
        de_DE: { crowdinId: 'de' },
        fr_FR: { crowdinId: 'fr' },
      },
      // collections/globals are optional:
      // - undefined => auto-detect localized fields and activate where applicable
      // - [] => disable
      // - ['posts', ...] or { slug, condition } => enable selectively / conditionally
    }),
  ],
})

Documentation

What this plugin adds

  • Collections:
    • crowdin-files
    • crowdin-article-directories
    • crowdin-collection-directories
  • Virtual field on localized docs/globals:
    • crowdinArticleDirectory (computed)