Translations
Translate Eleven Phone on FiveM without rebuilding: locales/es.json and en.json, keys, placeholders, plurals, number formats and how to add a new language.
The phone's text lives in locales/es.json and locales/en.json, at the root of the resource. Edit them and restart the resource to see the change: nothing needs rebuilding.
Config.Locale = 'en'
Adding a language
- Copy
locales/en.json(ores.json) using the new language code, for examplelocales/fr.json. - Translate the values.
- Adjust its
_metablock (below). - Set
Config.Locale = 'fr'in yourconfig.luaand restart the resource.
What gets translated and what doesn't
You translate the value on the right. Never change the key on the left: it's what the interface looks up, and changing it leaves the text blank.
Don't translate data (a carrier name, a balance, "5G") or ids, such as a wallpaper's or a plan's.
Placeholders and plurals
"saldo": "You have {amount} left",
"plural": { "one": "{n} message", "other": "{n} messages" }
Braces are filled in with the data. Plurals live inside the JSON, with one and other, so each language can follow its own rules.
Numbers and the clock
Each language has a _meta block with six keys: the language name, its code, the formatting locale, whether the clock is 12- or 24-hour, the decimal separator and the thousands separator.
"_meta": { "name": "English", "code": "en", "intl": "en-GB",
"hour12": false, "decimal": ".", "group": "," }
It deliberately isn't taken from the browser: inside the game, the system language is whatever language Windows was installed in.
If the JSON breaks
One stray comma and the phone doesn't go blank: it warns in the console and starts with the language built into it. And if your file comes from an older version, it's merged key by key with the factory one, so new keys appear in their original language instead of blank.
Tip
Updates replace locales/es.json and locales/en.json. If you've edited them, keep a copy before updating, or better, work on a file with a different code.
Plan names and descriptions (red.plan.<id> and red.desc.<id>) live here too: if you invent new plans in Config.Redes, add their texts (see Coverage).