# Translations

Every string of the inventory — the upstream ox_inventory strings and everything Koja adds, including the admin panel — lives in **one file per language**: `locales/<lang>.json`.

```text
ox_inventory/
└── locales/
    ├── en.json   -- complete, the fallback for every other language
    ├── pl.json   -- complete
    ├── de.json   -- upstream strings only
    └── ...
```

## Choosing the language

The language comes from ox_lib. Set the server default in `server.cfg`:

```cfg title="server.cfg"
setr ox:locale "pl"
```

If ox_lib lets a player pick their own language, the inventory loads that one for them.

## Which strings come from where

For every key, the first value found wins:

1. The value saved on the admin **Locales** page for that language (database).
2. `locales/<lang>.json`.
3. `locales/en.json`.

English and Polish ship with every string. The other languages (ar, cs, da, de, el, es, et, fi, fr, hr, hu, id, it, ja, ko, lt, nl, no, pt, pt-br, ro, ru, sl, sr, sv, tr, zh-cn, zh-tw) contain the upstream ox_inventory strings; Koja strings fall back to English until you translate them.

## Translating a language

:::steps

### Translate in game

Open `/invadmin` → **Locales**, pick the language (or **Add language** with a code like `de` or `pt-br`), and change the strings you need. **Only changed** shows what you edited.

### Save

Saved strings are pushed to every player immediately and stored in `koja_inv_locales`.

### Keep it in the file (optional)

**Export JSON** shows the whole language as one flat `{ "key": "text" }` object with a **Copy** button. Paste it into `locales/<lang>.json` so the translation also ships with the resource. **Import JSON** does the opposite: paste an object, review the changed strings and save.

:::

You can also edit `locales/<lang>.json` directly and restart the resource. Keys are flat, prefixed by area — `ui_koja_*` (inventory UI), `trade_*`, `shop_*`, `attach_*`, `discovery_*`, `give_*`, `koja_*` (messages from the server), `admin_*` and `adminui_*` (admin panel).

:::hint{type="info" title="Reset"}
**Reset to default** on the Locales page removes a database override, so the file value is used again.
:::

## Labels from config

Some labels are read from the locale first and from the config only as a fallback:

| Locale key | Config fallback |
| --- | --- |
| `clothing_slot_<key>` | `label` of the clothing slot in `data/koja/core.lua` |
| `fast_action_<id>` | `label` of the fast action in `data/koja/core.lua` |
