GitLab CI/CD Free
ByAndrii BodnarVerified Author

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

Try Crowdin

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: 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.

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 Mar 7, 2024

Published by Andrii Bodnar

Identifier:gitlab-ci