Obelum: keep translations in sync
Obelum is a library and a command line tool that keeps translations of a page in sync in a git repository. It does the bookkeeping for the method I describe in two other posts: Three-way translation merge: keeping translated pages in sync with an LLM and Generalizing the three-way translation merge to any direction.
The idea is that when a page changes in one language, an LLM gets the changes and edits the existing translation, so the corrections you made in the translation are kept. I call that a three-way translation merge. For that to work, you need to track what each language page looked like at the last sync. Obelum does that.
Two modes
One source language. You name a source language, and each other language keeps a copy of the source page as it was at its last sync. A language is out of date when its copy differs from the source page. You can edit a translated page freely, and those edits are not translated into any other language. This is the system in the first post.
No source language. Every language keeps a copy of every language’s file as it was at its last sync, so a change can start in any language and be translated into the others. This is the system in the second post.
In both modes the copies are ordinary files in a .obelum/ directory at the root of the repository.
What it does
With the copies, Obelum can:
- tell you which languages are out of date (
obelum status) - build what the translator gets, which is the copies, the diffs and the current page (
obelum brief) - run the translation with Claude and commit the result (
obelum translate) - record a change that should not be translated, like a correction (
obelum fix) - check the copies for problems, like a copy of a file that has been renamed (
obelum check)
npm install -g @obelum/cli
obelum init --langs sv,en --source en 'src/pages/{lang}/**/*.mdx'
obelum mark --all
obelum status
Leave out --source en if you want no source language. Each command that changes something makes one git commit.
When the pages can’t settle what to write, the translator asks. One example is when two languages have changed the same fee to different amounts. In a terminal you get the question with its options, and your answer goes back to the translator.
What the translator gets is plain data: the current page, the copies and the diffs. I use Claude, but another model, a translation service or a person could work from the same data.
I test the translator on 49 cases with one source language and 52 with none. The results are published, with every run and the prompt.
Status
Obelum is early. I use it through my CMS, Plinto, for our company website. The translation uses Claude through the Anthropic API, so you need your own API key.
If you try it and something breaks, please open an issue.