Skip to content

CI/CD Integration

Prevent deployment of missing or outdated translations by integrating Lingo.dev into your CI/CD pipeline.

Authentication Setup

Set up authentication in your CI/CD environment in three simple steps:

  1. Navigate to your Lingo.dev account dashboard
  2. Copy your project API key from the project settings page
  3. Add it as LINGODOTDEV_API_KEY in your CI/CD environment variables

Translation Verification with --frozen

The --frozen flag is essential for CI/CD pipelines:

bash
npx lingo.dev@latest i18n --frozen

This command:

  • Verifies all translations are up-to-date
  • Makes no changes to your files
  • Fails the build if translations are missing or outdated

Benefits of Verification

  • Prevents Incomplete Releases: Catches missing translations before they reach production
  • Maintains Quality: Ensures consistent user experience across all languages
  • Enforces Process: Makes translation updates a required part of development

How Verification Works

When you run the --frozen command:

  1. The system scans your source files for translatable content
  2. It compares source content with existing translations
  3. The build passes if all translations are current
  4. The build fails with a detailed error if any translations are missing

GitHub Actions Example

Add this to your workflow file:

yaml
jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: "20"
      - run: npm ci
      - run: npx lingo.dev@latest i18n --frozen
      - run: npm run build
      - run: npm run deploy

Best Practices

  1. Early Verification: Run the translation check before building your application
  2. Local Updates: When verification fails, run npx lingo.dev@latest i18n locally to update translations
  3. Version Control: Always commit the i18n.lock file with your code
  4. Automated Workflows: Consider setting up automatic translation PRs for new content

By integrating this simple verification step, you ensure your application is always deployed with complete, accurate translations in all supported languages.