Skip to main content

Languages

The RGS Platform features an automatic, AI-powered, translation system. The system works transparently when following a i18n standard.

Only deployed

Automatic translations only work on deployed assets.

Language files need to be placed under */locale/<langCode>/<asset>.json. When the game requests a language file in a language for which the translation file does not exist, the system will use the en one to generated a translated version of it. If the requested language file exist, it serves the original unaltered.

When requesting specific translations, the frontend system should behave by falling back from more specific to least specific, i.e.,

  1. Request region-specific language: <lang>-<region> (e.g. fr_CA)
  2. Request non-specifc language: <lang> (e.g. fr)
  3. Non-specific english: en

In the provided example, if fr_CA is not available (any error code -4XX/5XX-), fr should be requested. Finally, if fr is not available either, en should be requested. Variable translation, as per standard, should work the same way, if the translation file is available but the variable translation is not available in the file, it must fall back in the above order.

PRO TIP

Although from a resource-saving point of view, the download order should be respected, from a practical point of view, all three should be downloaded in parallel so, when parsing variables, all of the versions are availabe to fallback when needed, improving UX.

Docs

This logic is already handled by the frontend's RGS Connector

Additional Notes
  • In order to know the language to load in-game language files, the respective frontend API method must be used.
  • The game settings can, optionally, provide a way to change the language, in which case, the respective frontend API method must be used to override the current one.
  • As a minimum, all translation files must have an en version.
  • Translations can be tested by changing the browser's language or placing the lang query param in the launcher (which can be achieved using the Extra params box in the lab, e.g., lang=es)
  • Some translations may take a bit longer to generate, so the first time a translation is requested, the request might timeout and return a 408 (in which case, the game client should fall back as required).
  • When creating in-game texts, it is best to consider the possibility of them needing to be translated, using regular fonts where possible so they can fallback to the browser's ones if they are not available in the game's font.