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 translations.
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 automatic localization system can replace text within Text, Sprite Font, and Adaptive Text objects.
Usage in events
You can also use translation keys in native Construct 3 events and more.
The automatic localization system can replace {potions.mana}
with "Mana Potion" even during gameplay when it changes.
Moreover, you're not limited to just using Set text — you can change text however and whenever you want.
For example, you could trigger a typewriter animation when a button is pressed and everything will work.