Making Your Game Translatable

The process of making a game translatable is a difficult task. If one does not properly prepare a game to be translated, you can find yourself working hours over hours making spreadsheets of what elements need translating.

My approach to making our Language Immersion Virtual Environment (LIVE) application translatable was by having JSON files organized in a custom format that allowed me to quickly translate one language into another.

However, this format of translating required that I make a unique JSON structure for every new Data Structure and that each new Data Structure would require a new implementation of deserializing.

My goal with this ultimately is to have a way to quickly deserialize a machine-translatable JSON file into a Dictionary data type. This was, I could feed English UI keys into the application and receive the same key translated into any language I wanted.

Introducing Newtonsoft, a library dedicated to serializing complex data structures into neatly organized JSON files. With this, I could make a JSON file like so:

This format happens to be easily translatable. So with a little tweaking, the implementation looks as so:

Previously, The code implemented had to make a new System File Call every single time a new task was being generated. To alleviate this, I made two separate Dictionary data structures that take a Difficulty level as a key, and point to a Dictionary of Task Type / Description-Answer values.

These Dictionaries are then loaded once, at the very beginning of the game after a player selects their character. That character data contains the specified language that the player wants to learn, and with it, we can load the dictionaries.

This saves loads of processing time at the cost of whatever storage holding this data takes on the active application (It couldn’t be more than a few kilobytes).

From here, we now have to change our function allowing us to retrieve this data:

A simple searching function, should it return null, an error would be thrown. But now we have it! A way for us to consistently retrieve new tasks, generated dynamically, in an easily translatable format!

Here are some examples:

Now, as we can see, the translations aren’t perfect (I only know English, and I can clearly see some flaws here). But with a little fine-tuning, we’ll have a grammatically accurate set of generateable tasks!