payload-crowdin-sync
v0.42.1
Published
Automatically upload/sync localized fields from the default locale to Crowdin. Make these fields read-only in other locales and update them using Crowdin translations.
Maintainers
Readme
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
enginesinplugin/package.json
Install
npm install payload-crowdin-syncQuick 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
- Full docs (recommended):
https://thompsonsj.github.io/payload-crowdin-sync/ - Slate serializer reference & demos: slate-serializers — docs & demos
What this plugin adds
- Collections:
crowdin-filescrowdin-article-directoriescrowdin-collection-directories
- Virtual field on localized docs/globals:
crowdinArticleDirectory(computed)
