Checking translations

How to verify that translations exist

Introduction

Based on how your repository is configured, it may be possible for contributors to bypass the translation process or for the translation pipeline to never be triggered in the first place.

To guarantee that translations are available in production, we recommend running the following command as part of the deployment process:

npx lingo.dev@latest run --frozen

This command:

  1. Checks if all of the expected content is translated.
  2. Exits with a non-zero status code if all of the expected content is not translated.

CI/CD workflow examples

This section demonstrates how to set up minimal CI/CD workflows for checking translations.

Bitbucket Pipelines

Copy the following configuration into a .gitlab-ci.yml file:

check_translations:
  image: node:20-alpine
  script:
    - npx lingo.dev@latest run --frozen

To learn more about setting up Bitbucket Pipelines, see Bitbucket Pipelines.

GitHub Actions

Copy the following configuration into a .github/workflows/check-translations.yml file:

name: Check translations
on: [push, pull_request]
jobs:
  check_translations:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npx lingo.dev@latest run --frozen

To learn more about setting up GitHub Actions, see GitHub Actions.

GitLab CI/CD

Copy the following configuration into a bitbucket-pipelines.yml file:

pipelines:
  check_translations:
    - step:
        image: node:20
        script:
          - npx lingo.dev@latest run --frozen

To learn more about setting up GitLab CI/CD, see GitLab CI/CD.