Skip to content
Youness Fkhach · Writing · · 3 min readHomeWorkWritingResume

Localebot: localization without touching your codebase

Localebot is a GitHub App that finds untranslated strings in a pull request, lets translators and an AI model fill them in, and opens a second PR with the result. It reads existing locale files and keeps almost no state of its own.

LocalizationGitHubRuby on RailsArchitecture

A pull request adds checkout.promo_code to en.json. fr.json and es.json don’t get it. The PR merges, and depending on the i18n setup, production shows English text or a raw key.

Localebot catches that on the pull request itself. It’s a GitHub App I built. When a PR changes a source locale file, it comments with a link to a review session listing every string that’s missing or changed in the target languages. Translators fill them in, or ask an AI model for a suggestion and review it. Then Localebot opens a second PR with the translations, aimed at the author’s branch.

What it fixes

Mostly stateless

There’s no clone and no sync job. Each webhook runs the same sequence:

  1. Fetch three files from the GitHub API: the source locale at the PR’s base commit, the source at its head commit, and each target at head.
  2. Flatten them into key paths like auth.login.title, in memory.
  3. Mark a key missing if the target lacks it or it’s blank. Mark it modified if the target has a value but the source text changed since the base.
  4. Update the session and the PR comment.

There’s no translation memory and no ledger of what’s done. Whether a string is translated is whatever the target file says at the head commit, recomputed on every push.

It isn’t fully stateless, though. Two things persist:

Files are parsed in RAM and discarded. Apart from the PR comment, submitting is the only write to the repo. A job deep-merges the translations into the target files, commits them to localebot/pr-<n>, and opens the PR. Localebot ignores PRs from its own branches, so that second PR doesn’t start another session.

Nothing to change in the repo

The access it needs is read and write on contents and pull requests, through GitHub App installation tokens that expire after an hour.