Languages
The resource works with a per-profile language:
langis stored inmarketplace_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:
enes
Where the texts live
Section titled “Where the texts live”| 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.
Texts that are not for a single player
Section titled “Texts that are not for a single player”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.
Adding a language
Section titled “Adding a language”- Copy
locales/en.luaaslocales/<code>.lua(for examplelocales/fr.lua). - Change
Locales['en']toLocales['fr']and translate the values. - Add the same language to the interface in
html/scripts/core/i18n/. - Players can then pick it; set
Config.DefaultLang = 'fr'to make it the default.