Automate your frequent localization tasks such as uploading source files and downloading translations.
Use GitLab CI/CD to automate your common localization tasks such as uploading source files, downloading translations or anything else you can do with Crowdin CLI.
Push the crowdin.yml
configuration file to the repository.
Use Environment Variables for API Credentials:
"project_id_env": "CROWDIN_PROJECT_ID"
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
See the GitLab CI/CD variables to learn more about defining variables in GitLab CI/CD.
You need to set up the .gitlab-ci.yml
configuration file for GitLab CI/CD (or extend the existing one):
stages:
- translations
variables:
CROWDIN_PROJECT_ID: $CROWDIN_PROJECT_ID
CROWDIN_PERSONAL_TOKEN: $CROWDIN_PERSONAL_TOKEN
translations:
stage: translations
image: node:16.18
script:
- npm install -g @crowdin/cli
- crowdin -V
- crowdin status --no-progress
In this example, the job runs on Node image and installs the Crowdin CLI NPM package globally. After the CLI installation, you can execute any CLI command. It's recommended to use the --no-progress
flag for the CLI execution in CI/CD environment.
There is a possibility to store the downloaded translations as an artifacts using the --keep-archive
option with the crowdin download
command:
stages:
- translations
variables:
CROWDIN_PROJECT_ID: $CROWDIN_PROJECT_ID
CROWDIN_PERSONAL_TOKEN: $CROWDIN_PERSONAL_TOKEN
translations:
stage: translations
image: node:16.18
script:
- npm install -g @crowdin/cli
- crowdin download --no-progress --keep-archive
artifacts:
paths:
- CrowdinTranslations_*.zip
For more information about Crowdin CLI commands visit the official Crowdin CLI website.
Crowdin is a platform that helps you manage and translate content into different languages. Integrate Crowdin with your repo, CMS, or other systems. Source content is always up to date for your translators, and translated content is returned automatically.
Learn MoreReleased on Apr 13, 2023
Updated on Jul 12, 2024
Published by Andrii Bodnar
Identifier:gitlab-ci