https://github.com/thompsonsj/payload-crowdin-sync
Upload and sync localized fields from the default locale to Crowdin.
https://github.com/thompsonsj/payload-crowdin-sync
payload-plugin
Last synced: 3 months ago
JSON representation
Upload and sync localized fields from the default locale to Crowdin.
- Host: GitHub
- URL: https://github.com/thompsonsj/payload-crowdin-sync
- Owner: thompsonsj
- Created: 2023-04-24T17:24:40.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-17T14:20:01.000Z (about 1 year ago)
- Last Synced: 2025-03-26T12:38:06.194Z (about 1 year ago)
- Topics: payload-plugin
- Language: TypeScript
- Homepage:
- Size: 4.09 MB
- Stars: 8
- Watchers: 1
- Forks: 6
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Payload Crowdin Sync
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](plugin/README.md)
- Payload test installation: [dev](dev)
- Payload test installation (alternative config): [dev-alternative-config](dev-alternative-config)
- NX generated docs: [docs/nx.md](docs/nx.md)
## Quick start
```
npm install payload-crowdin-sync
```
Add the plugin to your Payload configuration.
```ts
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](https://payloadcms.com/docs/configuration/localization) in [Collections](https://payloadcms.com/docs/configuration/collections) and/or [globals](https://payloadcms.com/docs/configuration/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.

## Monorepo scripts
### Test
Run all tests.
- The `plugin` package contains unit tests.
- Both the `dev` and `dev-alternative-config` packages contain integration tests run against Payload installations.
```
npm run test
```
### Release
Build the plugin, change to the plugin directory and run `npm publish`.
```
npm run release
```