SakeTami
Droid Productions
Droid Productions

patreon


Localization update

Looking at the process, scripts and gotchas in using LLMs like ChatGPT for bulk-translation of AVNs.

A while ago I did a post on Localization; with the first pass of Love of Magic's translation entering the wild, I figured I should do a pass through it, look at what worked, and what hacks and solutions were employed to make things work.

There are essentially two core parts of the translation effort; dialog and UI/others. Because all dialog in Love of Magic is kept in structured data files, exporting all of them out is pretty trivial. The output looks like this.

GUID is just a unique identifier; every line in the game has a unique number attached, so I can easily match from the line back to the text.

Speaker is actually quite important; a lot of languages change based on the gender of the speaker, and in East Asian languages, also based on the relative age and position of the speaker. I didn't get TOO deep into that, but I did provide a 'cheat sheet' for the AI to translate from.

How well that worked itself into the actual translation is an open question; I don't speak Chinese or Russian, so I can't really say.

Those are the {extra_instruction}'s mentioned here. As someone who started programming 40 years ago, begging the LLMs not to screw up feels way too much like placating the machine-spirits, but that's the world we live in.

I've attached the script and a quick readme on how to install and use it, for anyone who's curious (or have their own game they want to translate). For this pass I used Grok 3-mini, but the API is largely the same for all the major AI vendors; just change the endpoints and model.

Translating LoM Book 1 (about 2.2MB worth of dialog, and another 250kb worth of assorted UI text strings) into 8 languages cost about $12, so cost wise it was fine if it helps people who'd otherwise struggle with the game.

I chose Grok over OpenAI or others mostly because it's so far the least prudish, and I don't want the Chinese translation of "You pull out of her, and push her to the ground. With a final few jerks you spray your cum over her face and chest. " to be "As a Large Language Model I cannot condone or translate acts of sexual degeneracy, including but not limited to facials, headpats and handholding."

Once that's all done, I set it to spend the next 3-4 hrs translating, and it spits out a text file with the GUID and translated text for each language.

UI

UI is in some ways easier, and in a lot of ways harder. We're less worried about tone and characters (so the text strings don't include speaker), but there's a bunch of other headaches. I never actually intended to localize Love of Magic, so the text strings are scattered everywhere. Literally everywhere; in the UI, in code, in prefabs and scripted objects. Hunting them all down and wrangling them into submission took more effort than everything else put together.

You're also dealing with button and text field sizes; German words are notoriously long ("Save" becoming "Speichern" is a common issue lamented by game translators), but French isn't much better. In the end that involved a big cup of coffee, loading up each language in turn, and doing a smoke testing pass looking for offending words overflowing. I doubt I got them all, but such is the curse of being a solo dev.

Renpy:

Much of that is pretty specific to my engine (Unity based with lots of custom scripts), but the bulk of AVNs on the market use Renpy. Here's how the localization setup there looks (from the Renpy manual).

Turns out it's actually a pretty good 1:1 match (perhaps unsurprisingly). Writing a Python script to parse all the rpy files in a given directory and spitting out text in the same format is actually quite easy.

start_636ae3f5 e Thank you for taking a look at the Ren'Py translation framework.

After that you feed it into the same script, then parse it back together again.

Conclusion

So. All bills in this was about 2 weeks of actual work, and another 2 weeks of playing whack-a-mole with outliers. I just pushed it live to default branch on Steam this week; we'll see what people think.

If you check out my Discord, there's a new #translation channel, which has all the raw translations. If you see something you disagree with in any of the languages (or would like new languages added to the set), just let me know there. Easiest is to download the latest .txt file, and uploading the changed version (since I wouldn't even know how to type most of the characters involved).

This post's a little more indepth than usual; I don't know if that's something people enjoy, or if most of you just want more wallpapers of cute girls instead. Let me know in the comments :)

Comments

Yeah. We'll see what people thing, and if it's something I should be spending time on going forward :)

Droid Productions

was this today on steam?

Phillip Chappell


More Creators