Skip to main content

Internationalization

RPGJS uses the same i18n shape on the server and the client. Modules can ship default translations, and the game can override them with provideI18n().

Configure Translations

Use the same config on both sides when the game needs translated gameplay text on the server and translated local UI on the client.

Translate Gameplay Text

The GUI APIs still receive final strings. Translate explicitly with player.i18n() or player.t().

Player Locale

The locale is stored in the player snapshot, so save(), load(), and session restore keep the selected language.

Module Defaults and Game Overrides

Reusable modules can provide default translations:
If the game provides the same key through provideI18n(), the game translation wins. Use namespaces such as quest.* or my-module.* for module keys.

Client Menus

Built-in RPGJS menus use rpg.* keys internally, such as rpg.menu.items and rpg.save.title. Override these keys in the game config to rename or translate the default menus.