The Dev Courier Team
Translation CI/CD Pipeline

Build an Automated Translation CI/CD Pipeline with Lingo.dev and Knock

Imagine launching your app globally without translation headaches. No more spreadsheets, no frantic emails—just pure automation. With Lingo.dev and Knock, that dream is reality. This guide walks you through setting up a seamless translation CI/CD pipeline, making localization effortless. Let’s dive in!

The Power of AI-Powered Localization

Localization is crucial for global app success, but manual translation is slow and error-prone. Enter Lingo.dev and Knock, your AI-driven translation and notification automation duo.

Crafting Seamless Notifications with Knock

Knock simplifies notification localization with:

Setting Up Your Translation Workflow

Local Translation with Lingo.dev CLI

  1. Install & Authenticate: npm install -g lingo.dev, then npx lingo.dev@latest auth --login.

  2. Configure Localization: Run npx lingo.dev@latest init to generate an i18n.json config:

    { "sourceLocale": "en", "targetLocales": ["es", "fr", "de"], "buckets": [{ "input": "locales/en.json", "output": "locales/[locale].json" }] }
  3. Generate Translations: npx lingo.dev@latest i18n creates translated files, tracking changes with i18n.lock.

Automating with GitHub Actions

  1. Translate on PRs:
    name: Translate on PR on: push jobs: translate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: lingodotdev/lingo.dev@main with: { api-key: ${{ secrets.LINGODOTDEV_API_KEY }} }
  2. Deploy to Knock on Merge:
    name: Deploy to Knock on: push jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - run: npm install -g @knocklabs/knock-cli - run: knock translation push --all env: { KNOCK_API_KEY: ${{ secrets.KNOCK_API_KEY }} }

Real-World Example

Adding "WelcomeMessage": "Welcome to the app!" to en.json triggers automatic translation and upload to Knock upon merging. Users instantly receive localized notifications—no manual work required.

Why This Pipeline is a Game-Changer

Taking Localization to the Next Level

Ensuring Quality

Handling Complex Localization

Optimizing for Scale

Wrap-Up: Your App, Global-Ready

By automating translation with Lingo.dev and Knock, you streamline localization, cut costs, and reach users worldwide effortlessly. Ready to revolutionize your app’s global experience? Start automating today!