GitLab CI/CD Free
ByAndrii BodnarVerified Author

Automate your frequent localization tasks such as uploading source files and downloading translations.

Try Crowdin

Automate localization tasks with GitLab CI/CD

Copy link

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.

Preparing the repository

Copy link

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.

Pipeline configuration

Copy link

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: crowdin/cli:latest
  script:
    - crowdin -V
    - crowdin download --no-progress

Tip: 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: crowdin/cli:latest
  script:
    - crowdin download --no-progress --keep-archive
  artifacts:
    paths:
      - CrowdinTranslations_*.zip

The examples above use the official crowdin/cli Docker image. Alternatively, you can use the Node.js CLI package:

stages:
  - translations

variables:
    CROWDIN_PROJECT_ID: $CROWDIN_PROJECT_ID
    CROWDIN_PERSONAL_TOKEN: $CROWDIN_PERSONAL_TOKEN

translations:
  stage: translations
  image: node:latest
  script:
    - npm install -g @crowdin/cli
    - crowdin -V
    - crowdin status --no-progress

In this example, the job runs on the Node image and installs the Crowdin CLI NPM package globally. Once the CLI is installed, you can run any CLI command.

For more information about Crowdin CLI commands, please visit the official Crowdin CLI website.

Localize your product with Crowdin

Automate content updates, boost team collaboration, and reach new markets faster.

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 More
Categories
Development
Works with
  • Crowdin Enterprise
  • crowdin.com
Details

Released on Apr 13, 2023

Updated on Jan 24, 2025

Published by Andrii Bodnar

Identifier:gitlab-ci