AI Translations (and a bonus)

This AI-generated beer label was created by the tool mentioned below
The beer I currently have on tap (but translated to French). A Tannenzapfle clone.

Although I am but a humble monoglot, there are brewers around the world, and I'd prefer my tools be available to them even if they don't speak English. To that end, I've spent the past few years trying to translate my projects into the languages their users actually speak. Given that these are hobby projects and I can't exactly afford a team of translators, I've been relying on AI tooling to keep everything up to date and reasonably accurate-ish.

As part of my year-end maintenance, I decided to rewrite my translation tool to make it more generic and easier to maintain—and to open source it in case someone out there finds it useful.

Oh, and due to a quirk in the way OpenAI used to run things, I've got a fun bonus release tucked in at the end.

Translation Tool

This tool is targeted at projects that use Vue and vue-i18n for internationalization, where strings requiring translation are stored in a large JSON dictionary. The tool tracks strings that were present during the last translation run, enabling both retranslation of changed strings, as well as the opportunity for improved translations of unchanged strings as AI models improve. The tool incorporates a "tiebreaker" mechanism for retranslations of unchanged strings to improve the quality of the final translation.

From testing with BrewPi-ESP, I would estimate that translation costs about $0.035/language/100 strings using gpt-5-mini as the base translation model and gpt-5.2 as the tiebreak model. As gpt-5.2 is roughly 7x as expensive as gpt-5-mini, replacing the tiebreak model can substantially reduce cost.

To use this tool you must have an OpenAI API key (this is different from ChatGPT). This API key can be provided to the tool by either:

  • Creating a .env file and adding the API key there (OPENAI_API_KEY=your-api-key-here)
  • Setting the API key as an environment variable (export OPENAI_API_KEY=your-api-key-here )

Full details including usage instructions and source code are available on GitHub.

Beer Label Maker

When I was writing the initial translation tool, I wanted to use OpenAI's latest models. At the time, you had to be an "active API user" to get access to these models, which meant that you had spent at least $5 through their API. In an attempt to run up my API bill, I built a tool to generate images through DALL-E. It worked, I forgot I built it, and left it sitting next to my translation tool.

Rather than delete the tool as I was cleaning up, I decided to spend an hour rebuilding it into something that might be fun to play with. That tool is now available on GitHub.

This tool is solidly in the camp of "things that nobody asked for - even me, given the circumstances", but hey - it can be fun to see what it spits out! Currently, each run costs roughly $0.005/image generated using the gpt-image-1-mini model for image creation and the gpt-5-mini for text/prompt generation.

To use this tool you must have an OpenAI API key on an account that is authorized to use the image generation APIs (which in turn requires ID verification), and the API key must be passed to the tool similarly as described for the Translation tool mentioned above.