AI-Powered Translations Bot

GitHub Action for AI-Generated Translations

Engineering tool that uses a cloud AI service via a GitHub Action, to automatically commit multiple language translations directly to an open GitHub Pull Request.

Overview

Translate Bot is a first-party GitHub Action, allowing Software Engineers that open PRs for code changes, adding new features and functionality. It allows the Software Engineer to easily trigger an AI-powered automation (via a PR reply) that will ensure that any English translations added to a codebase, are automatically translated into all other required languages. All translations are generated automatically and added into their PR, prior to it being merged.

Crucially, it uses a lower cost cloud-based LLM to generate translations, rather than use up some of the more premium AI tokens that an Engineer might otherwise use from their IDE allowance. This means that an Engineers’ agentic workflow can go further, focused on planning technical work and code changes.

The GitHub Action branches from the PR, creating a fresh branch. Whilst it loops through all modified or added English translation files, to make push commits to that branch for each set of locale files that it translates.

Approach

Within the files and source code of most apps, multi-language translations are typically store as separate files containing all translations for each language. A Software Engineer might have a locales/en.json file that lists all English translations, with separate files for other languages.

Whilst they were harnessing agentic workflows, I had noticed that when working on Shopify Apps the Software Engineers were typically using “expensive” AI tokens to generate the non-English copies of locale files. This often meant that the token usage was being abnormally spent, not on helping to refine complex problems or scaffold out solutions, but on relatively simple translation tasks.

Wrote as a relatively simple Python script, that is run via a GitHub Action that is tuned to look for PR replies, and detect the !translate-this trigger keyword.

By leveraging GitHub Actions, I was able to give all Software Engineers the ability to automatically have their base English locale files, automatically translate into all other languages and have this all handled consistently for all app codebases.

GitHub PR comments showing a translation bot being triggered, and the resulting translations being added to the PR automatically
Translate Bot being triggered in a PR

Outcome

Software Engineers can easily trigger a full translation run, via cloud-based generative AI, by simply replying to their PR in GitHub with !translate-this.

This ensures that translations are easily and consistently generated, without affecting their “heavier” development AI token allowance that can be better spent on engineering tasks. Translations are still generated by an accurate, cloud-based generative AI service but ultimately with a cost saving and leaner process.

Browse the Shopify Apps section of my portfolio .

Got a project in mind?

If something here looks like what you need, I'd be happy to talk it through.

Contact me