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:
- translate on every merged pull request
- translate when a release is published
Comparison
| Per merged pull request | Per release (chosen) | |
|---|---|---|
| Model cost | small per run, many runs. Strings that change before release are paid for each time | one run per release, only the final wording is translated. Languine tracks what changed in languine.lock, so unchanged keys are free |
| Review load | a new fr/ar pull request after nearly every merge, mostly one or two strings each | one batch with a checklist, read in one sitting |
| Review quality | the reviewer sees a string without its neighbours and the final English | the reviewer sees the whole release, can compare tone across screens and fix repeated terms once |
| Merge conflicts | parallel branches all touch fr.json and ar.json | translation files change in one place, once |
| Time to French and Arabic | minutes after the feature merges | after the release and its review. In between the English fallback shows |
| Noise | long history of tiny chore(i18n) pull requests, bot pull requests do not trigger CI by default | one 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
languineworkflow runs onrelease: publishedand onworkflow_dispatch - it translates
enintofrandar, runspnpm i18n:checkand opens one pull request on ai18n/<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,yasinis a placeholder to replace) - with no
LANGUINE_API_KEYorLANGUINE_BASE_URLsecret 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.jsonandar.jsonbetween 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_TOKENdoes not start CI. The workflow runspnpm i18n:checkitself. 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:
| Name | Kind | Value |
|---|---|---|
LANGUINE_API_KEY | secret | the key set on the self hosted deployment |
LANGUINE_BASE_URL | secret | the deployment url, like https://languine.your-team.example |
LANGUINE_PROJECT_ID | secret, optional | the project id printed by languine init |
Then replace the placeholder in .github/translation-reviewers.