Koja Scripts

Translations

How languages work: one locales/<lang>.json file per language, the ox_lib locale setting, English fallback and live overrides from the admin Locales page.

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.

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:

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

  1. 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.
  2. Save

    Saved strings are pushed to every player immediately and stored in koja_inv_locales.
  3. 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).

Labels from config

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

Locale keyConfig 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