Koja Scripts
FREE

Translations

Switch the HUD language, change a text, or add a language of your own.

Translations

Every text the HUD shows — the settings menu, the vehicle menu and the notifications it sends itself — comes from a JSON file in locales/. This page shows how to switch language, change a text, and add a language of your own.

Switching language

Set the file name, without .json, in editable/shared/config.lua:

editable/shared/config.lua
KOJA.Locale = 'pl'
CodeLanguage
enEnglish
plPolski
deDeutsch
esEspañol
frFrançais
hiHindi

Restart the resource. If the file does not exist, English is used. Locale files are read at runtime, so — unlike js.json — no UI rebuild is needed.

What is in a locale file

Two top-level sections:

SectionUsed for
uiThe settings menu (ui.settings) and the vehicle menu (ui.vehiclemenu)
gameNotifications from the engine, nitro, cruise control and seatbelt, for example game.nitro.texts.no_nitro
locales/en.json
{
    "ui": {
        "settings": {
            "main_title": "SETTINGS",
            "notify_settings": {
                "title": "Notification Settings"
            }
        },
        "vehiclemenu": {
            "title": "Vehicle Controls"
        }
    },
    "game": {
        "seatbelt": {
            "notify": { "title": "Seatbelt" },
            "texts": {
                "seatbelt_on": "Seatbelt has been fastened!",
                "seatbelt_off": "Seatbelt has been unfastened!"
            }
        }
    }
}

The title, description and label fields in options_settings are keys into ui.settings — "notify_settings.title" means ui.settings.notify_settings.title.

Changing a text

Edit the value in the file for your language and restart the resource. Keep the keys exactly as they are; only the values are yours to change.

Adding a language

  1. Copy English

    Copy locales/en.json to a new file named after the language code, for example locales/it.json.
  2. Translate the values

    Translate every value. Leave the keys, and the structure, untouched.
  3. Select it

    editable/shared/config.lua
    KOJA.Locale = 'it'
    Restart the resource.

Missing keys

  • In the settings and vehicle menus, a key missing from your file falls back to the English text built into the UI.
  • In notifications, a missing key is shown as the key itself, for example game.nitro.texts.no_nitro. With KOJA.Debug = true the F8 console names every missing key.

After updating the HUD, compare your file with the new en.json — new features bring new keys.