The repository owns the source strings, and Continuous Translations owns the translations. A pipeline pushes the first and pulls the second.
Push on every push #
ct snippet github and ct snippet gitlab print a ready-made job. The snippets skip pull requests from forks, which cannot read CI secrets, and you should do the same in jobs you write yourself.
A release that includes the translations #
- run: npx @continuous-translations/cli pull --require-complete 100
env: { CT_API_KEY: ${{ secrets.CT_API_KEY }} }
- run: npm run build && npm publish # or whatever your release doesThe pull step fails while a language is incomplete, so a release never ships half-translated.
Keep the files in sync #
Add ct pull --check to a pull request job to fail when a committed translation file is out of date. It writes nothing and exits 1 when a file differs.
Merging branches #
After a pull request was merged, run ct merge <branch> from the default-branch pipeline to merge the matching Continuous Translations branch into main.