Badly Translating Switch Games

As seen by my recent post about taking apart the Shantae Switch Port, I’ve slowly been learning about modding Switch games. Coincidentally, I’ve also been seeing quite a few videos about “badly translated games” in my YouTube Recommended section recently. For anyone who doesn’t know - “badly translated games” are a sort of ‘genre’ of game mods that take all text from a game’s files, run it through automated translator services (like Google Translate) multiple times and translate the result back to the original language. The result is, as you could imagine, a garbled mess of words that can sometimes actually be quite entertaining.

What I was fascinated by was the process of creating these mods. Apparently people actually sit there for hours and manually run every line of dialogue, every item name, simply everything through Google Translate one by one. I don’t have the patience to do that. So, obviously, I instead took the time to write a program that does it for me automatically instead.

The first obstacle with writing a program like this is the format in which text is stored in Switch Games. Most games use so-called MSBT files to store text, but actual documentation on the format of these files is very sparse and often incomplete. In fact, a lot of programs that specifically label themselves “MSBT Editors” often only support the most basic features. Sometimes a file simply isn’t recognized, sometimes the Editor can actually only read the contents of the files and not edit them, etc. All in all - MSBT files are tedious, despite their generally simple nature of “storing text”.

Kuriimu Logo

This is where Kuriimu comes in (which you can see the cute logo of above). Out of all the MSBT editors I’ve tried, the one in the Kuriimu Suite seems to be the most fleshed out, properly detecting text from multiple games’ MSBT files (including Paper Mario - The Origami King, which seems to be quite a challenging one) as well as supporting editing and saving modified MSBT files. So, after doing a bit of browsing through code, I managed to copy all the relevant code segments from the project and integrate it into my own. Now I was able to properly read, edit and save MSBT files, first challenge complete!

Next up - translation. As it turns out, finding translation services that you don’t have to pay a fortune for is just as challenging as finding documentation on the MSBT file format. After quite a while of searching and messing around with the Yandex Dictionary Service (which isn’t actually as free as it seems) I finally stumbled across Apertium, a free and open-source machine translation platform. And, luckily, a kind stranger had already created Apertium.Net, a library for the use of the Apertium API within C# projects, so I could quickly get started with translation.

Only a few hours later my program was already running and translating like there’s no tomorrow. Due to the fact that the Apertium API is free and community-hosted, the whole process takes quite a while to finish, but that’s still better than having to pay a fortune for quite literally bad translations.

Screenshot of MSBTranslator in action

And after just a little while I had badly translated my first MSBT file! Loading it up as a mod in Yuzu brought up this beauty of a settings screen in Paper Mario - The Origami King:

Screenshot of Paper Mario - The Origami King after running MSBTranslator

And with that I consider my mission accomplished. The project is titled MSBTranslator and available on GitHub. However, at the time of writing this post the functionality of the program is still somewhat limited, and not a lot of testing has been done with other games. I’ll keep working on it though, making improvements to the translation (since I’m not entirely happy with the way that currently works) and adding more features, such as a customized series of languages used for translation. Maybe I’ll make an update post once some more changes have been made, so stay posted!

Written on May 6, 2021