Pull requests

Automated pull requests

TolkBot creates and maintains translation pull requests automatically when you push changes to your base branch.


On by default

A new project opens pull requests on its own. Once you set up a language in the dashboard, every push to your default branch updates that language's pull request, with no click in between. Languages you haven't set up get no pull request.

Translations in a pull request use credits, the same as translations you start from the dashboard.

To turn it off, switch off Open pull requests automatically in the dialog where you set up languages, or Auto-create PRs under Settings → Workflow. With it off, you start translations from the Translations page and nothing happens on a push.

Projects created before automatic pull requests became the default keep the setting they had: off, unless someone switched it on.


How it works

When you push a commit that modifies your source locale files, TolkBot:

  1. Detects work — compares source and target files to find keys the target lacks, and checks every existing translation against the source text it was written for to find keys whose source changed
  2. Translates — sends new keys and eligible changed keys through the AI translation pipeline
  3. Commits — writes translations to the PR branch with the commit message chore(i18n): update {locale} translations, e.g. chore(i18n): update de translations
  4. Opens or updates a PR — creates a new PR or updates an existing one

Changed source text

Editing the text of an existing key — changing cta from "Start trial" to "Start free trial", say — updates its translations in the living PR, even though every target file already contains cta. TolkBot knows which source text each translation was written for, so it does not need to compare languages to notice the change.

Only translations TolkBot wrote itself, and nobody touched since, are replaced automatically. A changed key is left alone, and shown as needing attention in the dashboard, when:

  • a person wrote or edited the translation in the dashboard
  • the translation was edited directly in the repository after TolkBot generated it
  • the key is locked
  • a draft for the key is in progress
  • TolkBot has no record of who wrote the translation (for example, it existed before the project was connected)

For these keys the dashboard shows the old and new source text side by side. You can approve the existing translation as still valid, edit it, or re-translate it from there. The PR description lists how many translations were updated for changed source text and how many were kept for review.

A cosmetic edit to the source, such as a fixed typo, changed whitespace or straight quotes made curly, keeps its translations. TolkBot decides this per key and treats anything it is unsure of as a real change.

Pushing the same commit again, or a commit that changes nothing in the locale files, creates no new work. A source edit that lands while TolkBot is writing is withheld from that write and picked up by the next run.


Removed and renamed keys

A push that removes a key from the base language file removes its translations, and a push that renames one moves the translation to the new name. A translation a person owns is kept, and a push that removes a large part of a file removes nothing. See Removed and renamed keys.


Living PRs

TolkBot uses a living PR pattern — one persistent PR per target language. Instead of creating a new PR for every push, TolkBot updates the same PR branch with new translations as you add content.

This means:

  • The PR accumulates translations over time
  • You can review all pending translations in one place
  • Merging the PR applies all translations at once
  • After merging, TolkBot creates a new PR for future translations

TolkBot never merges your base branch into its PR branch and never force-pushes it. It only commits to the branch when it has translations to write. Its commits touch only the target language's files, so the PR usually merges cleanly. If someone edits the same target file on the base branch while the PR is open, resolve the conflict on GitHub as you would for any pull request.


Branch naming

By default, TolkBot creates branches with the pattern:

tolkbot/{project}-i18n-{lang}

{project} is the project's slug. For a project called web: tolkbot/web-i18n-de, tolkbot/web-i18n-fr, tolkbot/web-i18n-es.

You can customize this pattern in workflow settings.


PR details

Title

chore(i18n): Add German translations (15 keys)

The count covers every run on the pull request. A pull request that only removed keys or moved translations to renamed keys says that instead, and one made of edits from the dashboard is titled chore(i18n): German translation edits (3 keys).

Description

The description is rewritten on every run from what the runs on the pull request did:

  • Summary: keys added, translations updated for changed source text, keys removed, translations carried to renamed keys, and translations kept for review because a person owns them
  • Checks: how many keys were translated or failed, what was written to the branch and what was withheld (with the reason, such as a locked key or a value that would have been empty), and what the review pass found
  • File checks, a line in the Checks section when the written files need a look: a plural missing a form the language needs, a value not in the language's script, a sentence left as the source, a repeated source string translated two ways, or a file formatted differently from the base file. TolkBot writes these values and reports them; it doesn't hold them back.

The Checks section ends with what needs attention, or says that nothing does.

Labels

TolkBot adds no labels by default. Set PR labels in workflow settings to have them added when a PR is opened.

Draft PRs

You can configure TolkBot to create PRs in draft state, giving you time to review before they show up as ready for merge. Enable this with the createAsDraft setting.


Trigger conditions

A push triggers translation only when all of these conditions are met:

  1. The push is to a monitored branch (configured via baseBranches)
  2. The push modifies files within the project's subpath (for monorepos)
  3. autoCreatePR is enabled in the project's workflow settings (on for a new project)
  4. The pusher is not in the ignoreUsers list

A push that meets them updates one pull request per language that is set up.


What's next

Previous
Connect GitHub