Automatic language detection

Item 2.14 of the Game Requirements

The game includes automatic language detection via SDK.

Integration

Warning

Auto-detection via the SDK must:

  • Occur during launch, not during gameplay.
  • Be implemented in all games, even if they declare only one language or have no text.

To determine the user's language, get the language code from the environment.i18n.lang parameter:

1const ysdk = (await YaGames.init());
2const lang = ysdk.environment.i18n.lang; // 'en', 'ru', ...

Then use the lang variable when loading game translations.

Verification method

Checking one language

To make sure the game language is detected automatically:

  1. Clear the browser cache.

  2. Open the game with the debug panel:

    1. Open the Yandex Games console.
    2. Select the game you need.
    3. In the top left corner, click on Open with debug panel.
    1. Open the required game.

    2. Add &debug-mode=16 to the end of the browser's address bar.

      Example link: https://yandex.com/games/app/XXXX?debug-mode=16, where XXXX is the unique game ID.

  3. Check that language auto-detection via the SDK works on the first game launch:

    Background

    Text

    Value

    I18N is used

    Auto-detection is enabled.

    I18N is not used

    Auto-detection is not enabled.

    Warning

    The 文 indicator color should change to green at startup, not during gameplay. A short interval for loading the language is acceptable: at startup, before the indicator changes from red to green, loading text in another language may be displayed.

Examples

Game

Comment

The player clicks "Play", and only after that the language indicator changes from green to red.

🚫 Auto-detection is enabled after the level starts. Such a game will not pass moderation.

The indicator changes color from red to green during loading. The game is in Russian only, the "Loading" text is initially in the correct language.

✅ There is a short delay before auto-detection is enabled, the language is initially correct (the game is in RU only).

The indicator changes color from red to green during loading. At the same time, the text "Загружаемся" changes to "Loading", which matches the selected game language - English.

✅ There is a short delay before auto-detection is enabled, the text language changes along with the indicator color change (EN language).

Checking multiple languages

Moderation checks game localization for all languages specified on the Draft tab in the Game translated into field.

Repeat the basic check for each declared language. To do this, open the game sequentially in all these languages:

  1. On the debug panel, click SDK mocks ⚒️.
  2. In the dropdown list with the language designation (for example, En ), select the one you need. The game will open in this language in a new browser tab.

Note

If the game has manual language switching, moderation will only check the implementation for technical and logical errors. To improve player experience, check on your own that you follow the recommendations from item 6.9 of the Game requirements.

Example of manual language selection

Manual language selection menu inside the game.

Moderation verdicts:

  • ✅ If all declared languages loaded — the game will pass moderation.
  • 🚫 If at least one language did not switch (fully or partially) to the one selected on the debug panel — the game will be rejected for lack of translation. At the same time, moderation takes into account exceptions that do not need to be translated (see the calibration list for item 8.2.3).
  • ✅ It is acceptable if after refreshing the page with the game, auto-detection is absent in cases where the developer has implemented language saving in cache.

Contact moderation

If you believe that language auto-detection works correctly in the game and it was removed from publication or not admitted to it by mistake, please fill out the form below.

The quality control service of moderation will re-check the decision and return the game if it was blocked unjustly.

Open the form

The code is specified in ISO 639-1 format. For example, "tr" means that the game is currently running in the Turkish interface of Yandex Games. All supported languages are listed on the Languages and domains page.