Text localization

One of the core features of this plugin is the automatic text translation system.

All you need to do is prepare translations in JSON format and you can freely apply them in your new or existing project.

The main principle we followed during development is to avoid adding extra code to your project. Often, you won't need to write any code at all to localize your game.

Creating Translation Files

The first step in localizing your game is preparing the JSON translation files.

First, create an i18n folder inside the Files directory. Then create JSON files in this folder named using language codes in ISO 639-1 format.

As an example, let's create en.json and ru.json files with the following content:

{
"game": {
    "title": "First Fantasy 10"
},
"potions": {
    "health": "Health Potion",
    "mana": "Mana Potion"
}
}
{
"game": {
    "title": "Первая Фантазия 10"
},
"potions": {
    "health": "Зелье жизни",
    "mana": "Зелье маны"
}
}

This creates translations for two languages: English and Russian. Now we can use them in our project.

Usage in Layouts

Next, to use our translations, let's create a text object in the layout and give it the value {game.title}.

Now when you press the play button (preview), you'll see the magic — our text automatically changes to "First Fantasy 10".

This happens because our localization system replaces text in Text, Sprite Font, and Adaptive Text objects.

Usage in Events

You can also use translation keys in native Construct 3 events and more.

The localization system will replace {potions.mana} with "Mana Potion" even during runtime.

Moreover, you're not limited to just Set text — you can change text however and whenever you want.

For example, you could trigger a typewriter effect on button press and everything would work.


Repository