Introduction
For version 4.0 of Rigelian, I added localization support from the start. The .xcstrings catalog in Xcode makes it really easy to manage strings and instantly see translation status.
But… you still have to translate everything yourself.
Using AI for Translations
AI tools like ChatGPT make translating text into multiple languages much easier. You can paste JSON from your .xcstrings file (or even the whole file), and get decent translations back.
That works fine at first—but it quickly becomes annoying when:
- you keep adding new strings
- you add new languages later
What I really wanted was simple:
A tool that reads a
.xcstringsfile and fills in the missing translations automatically.
Building a macOS AI Translation Tool
There are commercial localization tools out there, but they felt like overkill for this use case.
Instead, I decided to build a small macOS app using OpenAI Codex.
I created a new Xcode project called AI Translator and gave the built-in AI agent this prompt:
Create a macOS app to translate entries in a .xcstrings file using OpenAI.
The app shall allow to select a .xcstrings file from anywhere on the filesystem.
The app shall have 2 columns, column 1 shall list all entries to be translated including there translation status, column 2 shall show the translations per language.
The app shall have a toolbar that contains:
- A filter for strings that are fully translated, not translated, partially translated or not to be translated.
- A button to fetch translations for all not translated and partially translated items using OpenAI.
- A button to fetch translations for the selected entries in column 1.
- It shall be possible to add additional languages.
The app shall show progress when fetching translations, and stay responsive.
The app shall have a settings view where an OpenAI token can be entered.
The app shall allow saving the .xcstrings file. The order of items shall be consistent when saving, to make comparison between versions of the file easy.
The Result
The first version had a few rough edges, but after some small tweaks, I had a working app in about 2 hours.
In a recent Rigelian update, I added ~10 new strings—and translating them took just a few seconds.
That’s a pretty big win compared to doing it manually.
Source Code
I’ve open-sourced the project here:
👉 https://github.com/katoemba/ai-translator
Feel free to fork it, improve it, and open a pull request 🙂
Ideas for Improvements
There’s still plenty of room to expand this:
- Show estimated OpenAI cost per translation batch
- Cache translations (translation memory)
- Add context-aware translations for better quality
- Handle pluralization (
.stringsdict) - Add a review/approval step before saving
Final Thoughts
This was a fun example of using AI not just inside an app, but to build developer tooling itself.
Something that used to be repetitive and time-consuming is now basically instant—and integrated right into the workflow.
If you’re working with localization in Xcode, this kind of tool can save a lot of time.