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.
- Plugin docs: plugin/README.md
- Payload test installation: dev
- Payload test installation (alternative config): dev-alternative-config
- NX generated docs: docs/nx.md
npm install payload-crowdin-sync
Add the plugin to your Payload configuration.
import { crowdinSync } from "payload-crowdin-sync";
export default buildConfig({
plugins: [
crowdinSync({
projectId: 323731,
token: process.env.CROWDIN_TOKEN,
organization: process.env.CROWDIN_ORGANIZATION,
localeMap: {
de_DE: {
crowdinId: "de",
},
fr_FR: {
crowdinId: "fr",
},
},
sourceLocale: "en",
}),
],
// The rest of your config goes here
});
On save draft or publish, content from localized fields in Collections and/or globals is organised into directories and files within a Payload CMS
directory (configurable) in your Crowdin project.
To load translations into Payload CMS, check the Sync all translations
checkbox on a given collection document/global and save draft (loads translations as draft) or publish.
Run all tests.
- The
plugin
package contains unit tests. - Both the
dev
anddev-alternative-config
packages contain integration tests run against Payload installations.
npm run test
Build the plugin, change to the plugin directory and run npm publish
.
npm run release