Skip to content

Languages

The resource works with a per-profile language:

  • lang is stored in marketplace_users
  • the UI adapts its texts to profile.lang
  • every message the Lua sends — notifications, errors, prompts in the world, the robbery minigame, blips and mailbox notes — goes out in the language of the player who receives it (since 1.16.0)
  • categories and rarities also have bilingual labels
  • numbers, dates and money are formatted by language

Current languages:

  • en
  • es
Texts File Encrypted
Interface html/scripts/core/i18n/en.js, es.js No
In-game messages from Lua locales/en.lua, locales/es.lua No

Each line of locales/*.lua is key = 'text',. You can reword any text; keep its %s / %d placeholders in the same order, because they are filled with names, amounts and items. A missing key falls back to English, and if it is missing there too, the key itself is shown so the gap is easy to spot.

A few texts are read by more than one person, so they use Config.DefaultLang: Discord logs, the labels the script adds to a listing (such as a bundle’s name or a vehicle’s generic name), refund resolution notes and the reason passed to the OnInPersonTradeCancelled hook.

  1. Copy locales/en.lua as locales/<code>.lua (for example locales/fr.lua).
  2. Change Locales['en'] to Locales['fr'] and translate the values.
  3. Add the same language to the interface in html/scripts/core/i18n/.
  4. Players can then pick it; set Config.DefaultLang = 'fr' to make it the default.