---
metadata:
  - name: generator
    content: Diplodoc Platform v5.64.0
alternate:
  - https://yandex.com/dev/games/doc/en/sdk/construct-3/text-localization.md
  - https://yandex.com/dev/games/doc/hi/sdk/construct-3/text-localization.md
  - https://yandex.com/dev/games/doc/ko/sdk/construct-3/text-localization.md
  - https://yandex.com/dev/games/doc/ru/sdk/construct-3/text-localization.md
  - https://yandex.com/dev/games/doc/tr/sdk/construct-3/text-localization.md
  - https://yandex.com/dev/games/doc/vi/sdk/construct-3/text-localization.md
  - https://yandex.com/dev/games/doc/zh/sdk/construct-3/text-localization.md
  - href: https://yandex.com/dev/games/doc/en/sdk/construct-3/text-localization.md
    type: text/markdown
    title: Markdown version
  - href: https://yandex.com/dev/games/doc/en/llms.txt?revision=r21861215
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/games/doc/en/llms.txt?revision=r21861215

# Text localization

<!-- source: en/_includes/script-common.md -->
<!-- source: en/_includes/script/index-js.md -->

<!-- endsource: en/_includes/script/index-js.md -->

<!-- source: en/_includes/script/requirements-js.md -->

<!-- endsource: en/_includes/script/requirements-js.md -->

<!-- source: en/_includes/script/image-modal-js.md -->

<!-- endsource: en/_includes/script/image-modal-js.md -->
<!-- endsource: en/_includes/script-common.md -->

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 {#create-i18n-files}

To localize the game, prepare JSON translation files:

1. In the `Files` directory, create a folder named `i18n`.
1. In the created folder, create JSON files and name them with the appropriate language codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes){.external} 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.](../../_images/construct-3/text-localization/create-i18n-files.gif)

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

{% list tabs %}

- `en.json`

    ```json showLineNumbers
    {
        "game": {
            "title": "First Fantasy 10"
        },
        "potions": {
            "health": "Health Potion",
            "mana": "Mana Potion"
        }
    }
    ```

- `ru.json`

    ```json showLineNumbers
    {
        "game": {
            "title": "Первая Фантазия 10"
        },
        "potions": {
            "health": "Зелье жизни",
            "mana": "Зелье маны"
        }
    }
    ```

{% endlist %}

These English and Russian translation files can be used in the project.

## Usage in layouts {#use-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.](../../_images/construct-3/text-localization/example.webp)

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](https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/text){.external}, [Texture Font](https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/sprite-font){.external}, and [Adaptive Text](https://yandex.com/dev/games/doc/en/sdk/construct-3/adaptive-text.md){.external} objects.

![Construct 3 screenshot: the Editor window (left) contains the text "{game.title}". The Preview window (right) contains the text "First Fantasy 10".](../../_images/construct-3/text-localization/result.webp)

## Usage in events {#use-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$"". The Preview window displays the text "Mana Potion = 10$".](../../_images/construct-3/text-localization/runtime-set-text.webp)

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$" over 3 seconds". The Preview window only has a white button labeled "Button". The user clicks it, and the text "Mana Potion = 10$" begins to appear letter by letter.](../../_images/construct-3/text-localization/runtime-typewrite-text.gif)

---


<!-- source: en/_includes/sdk/button-git.md -->
<a href="https://github.com/yandex-games-plugins/construct3">
  <span class="button">Repository</span>
</a>
<!-- endsource: en/_includes/sdk/button-git.md -->
