# 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`:

```lua title="editable/shared/config.lua"
KOJA.Locale = 'pl'
```

| Code | Language |
| --- | --- |
| `en` | English |
| `pl` | Polski |
| `de` | Deutsch |
| `es` | Español |
| `fr` | Français |
| `hi` | Hindi |

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:

| Section | Used for |
| --- | --- |
| `ui` | The settings menu (`ui.settings`) and the vehicle menu (`ui.vehiclemenu`) |
| `game` | Notifications from the engine, nitro, cruise control and seatbelt, for example `game.nitro.texts.no_nitro` |

```json title="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`](/free/hud/player-settings#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

:::steps

### Copy English

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

### Translate the values

Translate every value. Leave the keys, and the structure, untouched.

### Select it

```lua title="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.
