Glitched Scripts
Advanced Trailers

Localization

Locales, Config.Locale, and adding a language.

All player-facing UI and notification strings live in locales/*.json (flat snake_case keys). That folder is escrow-ignored, so you can edit or add files.

Lua notifies call locale('some_key') (ox_lib). The UI uses the same strings from Lua (title, hint, menu labels), so one file covers both.

Config.Locale = 'es' -- bundled: en | es | pt | de | fr | pl

The resource calls lib.locale(Config.Locale or 'en') on start. Restart after you change it. If you already set the ox:locale convar for other ox_lib resources, keep Config.Locale matching that convar so everything stays on one language.

%s in a value is a placeholder (locale('btrain_limit_reached', limit)). Keep the same number of %s as English. Do not translate _G[S]cripts.

Ramp label strings in Config.Trailers are not locale keys. Edit those in config if you want them in another language.

Add a language

  1. Copy locales/en.json to locales/<code>.json (for example locales/nl.json)
  2. Translate values only. Keys must stay identical or that string falls back / shows the key
  3. Set Config.Locale = 'nl' and restart

On this page