Tutorial

Hook Mergua into CI

Your pipeline pushes the keys your code uses and pulls the translations back into the repository. One API key, a few questions about your repository, the job the CI tab writes from the answers, and the first run — read where Mergua records it.

5 minutes · 4 steps Updated

A loop: the sync script pushes the locale files in your repository to Mergua, translators write the new keys in Mergua, a translations.changed webhook starts your CI pipeline, and the sync script pulls the finished translations back into the repository.

  1. Step 01

    Create an API key

    On the project’s API Keys tab, name a key after the pipeline that will use it and create it — then store it in your CI settings as the masked variable MERGUA_API_KEY, because Mergua shows it only this once.

    How it works: Mergua CLI

  2. Step 02

    Answer the CI tab’s questions

    Open the CI tab and answer its questions about your repository one at a time — the last one, the git provider, decides whether the job is written for GitLab CI or for GitHub Actions.

    How it works: Mergua CLI

  3. Step 03

    Copy the job the CI tab writes

    Pick GitLab and the CI tab writes the snippet for GitLab CI from your answers — copy it into the file it names as it stands, and change an answer above it rather than the snippet.

    How it works: Mergua CLI

  4. Step 04

    Read what the run did

    Push a commit, and once the job has run the Sync tab lists it — which key it ran with, on which branch, and what it pushed and pulled.

    How it works: Mergua CLI

Where to go from here

The documentation covers everything this walkthrough skipped, and the other tutorials take the next task from here.

Do it with your own files.

Start on the free tier with the locale files you already have.

Create your account