• Register
Post news RSS Field Hospital: Devlog #2. Localization

In this entry of our devlog we'd like to talk about our approach to localization.

Posted by on


Field Hospital: Dr. Taylor's Story belongs to a genre of "document thriller" which was formulated by Lucas Pope for his famous "Papers, Please". Basically it means that it is a narrative-driven game almost entirely based on different text information: patients' cards, criminal records, notes and letters. Gameplay itself is focused on using variety of documents.

As a developer from non-English-speaking country I want my games to be available to as many players around the world as possible. That's why from the very beginning of the development we decided to make localization system that is easy to use and can be prepared for translation with minimal effort.

The heart of localization system are simple xml files. Anticipating the question we choose xml instead of json or other formats just because I as a programmer had ready-to-use scripts of xml-converter.

All texts are stored in xml files. But the editing is held in Google Sheets. Our team consist of only two members from different cities so it makes it easy to communicate and keep texts up-to-date.

For example that's how patient's profiles look like in Google Sheets

For example that's how patient's profiles look like in Google Sheets


Using simple Google Apps script we convert sheets to text files. Field Hospital is running on Unity and for every bit of text on screen we use default UI.Text component.

All of the fields and labels of the medical blank are default UI.Text components

All of the fields and labels of the medical blank are default UI.Text components


For frequently repeated names and UI elements we wrote LocalizedText script. For each piece of text there is an element in dictionary.xml file and corresponding element in LocalizedTextType enumeration type.

public enum LocalizedTextType
{
    STARTGAME,
    QUITGAME,
    TUTORIAL,

    NAME,
    RANK,
    DIVISION,
    AGE,
    SEX,
    EVALUATION,
    WOUND,
    SIGNATURE,

    SETTINGS,
    CONTINUE,
    NEWGAME,
    APPLY,
    DEFAULT,
    CURRENTLANGUAGE,
    LANGUAGE,
    TOMAIN
}

Dictionary file in Google Sheets

Dictionary file in Google Sheets


To prepare it for translation we just need to copy column with values and send it to translator. Each language is stored on separate sheet named correspondingly. In Unity we add LocalizedText script to a UI.Text component and select required type of text. There are several options available: make all letters uppercase or lowercase, add text or chars before or after text.


At start LocalizationManager loads text assets for language set in player's settings. Every LocalizedText game object then gets corresponding string from LocalizationManager. Same goes for every other text bits like briefings and tutorial descriptions. Patients are stored in separate text asset each.

Some texts may have more characters in one language than in other. We think up ahead so to prevent text in different languages to crop or overflow we use two approaches.

For UI elements or short texts we left empty space and set UI.Text component to Best Fit.


For long texts with many strings we use ScrollView component and as its Content use Text with ContentSizeFitter set for vertical fit which expands transform depending on amount of text and adds vertical scroll bar if needed.


The way we design the system let us change language in-game without restarting. That's a great benefit for testing translations.


If you have any questions feel free to ask them in comments.

You can follow us on Twitter and add Field Hospital to wishlist on Steam:

Stay safe and healthy!

Nick from Gard Interactive.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.