le-hoetel
Decisions

Languine per release

Why French and Arabic are machine translated once per release and not on every merged pull request.

Status: accepted, November 2026

Context

English is the source language. fr and ar are generated by a self hosted Languine from packages/i18n/src/messages/en.json. The model output is a first draft: hotel guests read it, and the consent and unsubscribe wording is legal text, so a human has to read every change before it ships. Until a missing key is translated the apps show the English text (see Languages and RTL), so lag is visible but never broken.

Two triggers were possible:

  1. translate on every merged pull request
  2. translate when a release is published

Comparison

Per merged pull requestPer release (chosen)
Model costsmall per run, many runs. Strings that change before release are paid for each timeone run per release, only the final wording is translated. Languine tracks what changed in languine.lock, so unchanged keys are free
Review loada new fr/ar pull request after nearly every merge, mostly one or two strings eachone batch with a checklist, read in one sitting
Review qualitythe reviewer sees a string without its neighbours and the final Englishthe reviewer sees the whole release, can compare tone across screens and fix repeated terms once
Merge conflictsparallel branches all touch fr.json and ar.jsontranslation files change in one place, once
Time to French and Arabicminutes after the feature mergesafter the release and its review. In between the English fallback shows
Noiselong history of tiny chore(i18n) pull requests, bot pull requests do not trigger CI by defaultone pull request per release

The honest cost of the release model is the gap: if production deploys from main on every merge, a hotel can see English strings for a few days. The honest cost of the per pull request model is that nobody reviews tiny translation pull requests carefully, which is how bad Arabic reaches guests.

The money is not the deciding factor. Our message files are small, so model cost is cents either way. Human review time, especially Arabic, is the scarce resource, and batching it is the real saving.

Decision

Translate once per release, with a manual run for urgent changes.

  • the languine workflow runs on release: published and on workflow_dispatch
  • it translates en into fr and ar, runs pnpm i18n:check and opens one pull request on a i18n/<tag> branch with the review checklist in .github/translation-pr-body.md
  • if a translation pull request is already open it does nothing, so there is never more than one
  • reviewers come from .github/translation-reviewers (one GitHub login per line, yasin is a placeholder to replace)
  • with no LANGUINE_API_KEY or LANGUINE_BASE_URL secret the workflow ends with a notice and no failure

Use the manual run when a feature must reach French or Arabic hotels before the next release: Actions, languine, Run workflow.

Why

  • human review of Arabic is the scarce resource, one batch with a checklist gets read, many small pull requests do not
  • only the final English wording is paid for and translated
  • reviewers see tone across a whole release and fix repeated terms once

Why not

  • per merged pull request: faster, but many tiny review pull requests, repeated cost for strings that change again, and merge conflicts on fr.json and ar.json between parallel branches

Consequences

  • cut releases often, and before a feature that matters to French or Arabic guests goes to hotels
  • a change that cannot wait for a release, such as consent or unsubscribe wording, gets a manual run and a reviewed pull request the same day
  • a pull request opened with the default GITHUB_TOKEN does not start CI. The workflow runs pnpm i18n:check itself. To get full CI on it, close and reopen the pull request, or set up a token for the workflow later
  • the files translated are listed in languine.json. Docs pages and email templates join it when they move to translatable files

Revisit when

A release train slower than a week leaves hotels on English too long, or the English wording changes so little that per merge pull requests would be cheap to review.

To enable

Add these in repository settings, Secrets and variables, Actions:

NameKindValue
LANGUINE_API_KEYsecretthe key set on the self hosted deployment
LANGUINE_BASE_URLsecretthe deployment url, like https://languine.your-team.example
LANGUINE_PROJECT_IDsecret, optionalthe project id printed by languine init

Then replace the placeholder in .github/translation-reviewers.

On this page