Text localization

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

To use it, prepare translations in JSON format so you can apply them in your projects. In most cases, you can localize your game without adding any new code.

Creating translation files

To localize the game, prepare JSON translation files:

  1. In the Files directory, create a folder named i18n.
  2. In the created folder, create JSON files and name them with the appropriate language codes in ISO 639-1 format.

Video of working in Construct 3: the file structure is located in the upper left part of the screen. Part of the folder list is visible: "Videos", "Fronts", "Icons", "Files". The user selects the "Files" folder and chooses the "Add subfolder" option from the context menu. A new folder appears in the "Files" folder, and the user names it "i18n". Then they select the new "i18n" folder, choose "New" → "JSON" from the context menu, and name it "en.json". Then, in the same "i18n" folder, they create a "ru.json" file.

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

1{
2    "game": {
3        "title": "First Fantasy 10"
4    },
5    "potions": {
6        "health": "Health Potion",
7        "mana": "Mana Potion"
8    }
9}
1{
2    "game": {
3        "title": "Первая Фантазия 10"
4    },
5    "potions": {
6        "health": "Зелье жизни",
7        "mana": "Зелье маны"
8    }
9}

These English and Russian translation files can be used in the 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}.

Construct 3 screenshot: a text object is highlighted on a gray background, appearing as a black label "{game.title}". A popup window is open nearby, with "Text" written in the center of its top panel. Most of the popup window is a text field, with "{game.title}" written in its upper left part. In the lower right part of the window, there are "OK" and "Cancel" buttons, with the pointer hovering over the "OK" button.

To test the translation, click the Play button (preview). In the Preview window, the text will change to "First Fantasy 10". This happens because the automatic localization system can replace text inside Text, Texture Font, and Adaptive Text objects.

Construct 3 screenshot: the Editor window (left) contains the text "{game.title}". The Preview window (right) contains the text "First Fantasy 10".

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.

Construct 3 screenshot: a table is located at the top of the screen. It consists of three horizontal cells: the "System" settings icon, "On start of layout", the letter "T" icon in a dashed square, and the text "Text | Set text to "{potions.mana} = 10".

You can use not only Set text; you can change the text however and whenever you want.

For example, you can run a text typing animation when a button is pressed.

Video of working in Construct 3: a table is located at the top of the screen. It consists of three horizontal cells: the "OK" icon and the text "Button", "On clicked", the letter "T" icon in a dashed square, and the text "Text | Typewriter text "{potions.mana} = 10" begins to appear letter by letter.


Repository