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:
- Navigate to your Lingo.dev account dashboard
- Copy your project API key from the project settings page
- 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:
- The system scans your source files for translatable content
- It compares source content with existing translations
- The build passes if all translations are current
- 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
- Early Verification: Run the translation check before building your application
- Local Updates: When verification fails, run
npx lingo.dev@latest i18n
locally to update translations - Version Control: Always commit the
i18n.lock
file with your code - 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.