Languages
Run MayoNav in English, French, Spanish, German or Dutch, or add your own language.
New in 1.7.0. See Updating to 1.7.0.
MayoNav comes in five languages. Set the one your server uses in config.lua, under Config.AccentColor:
Config.Locale = 'en' -- 'en', 'fr', 'es', 'de' or 'nl'| Code | Language |
|---|---|
en | English (default) |
fr | French |
es | Spanish |
de | German |
nl | Dutch |
Restart mayo_nav after changing it. The language is the same for every player on the server.
What's translated
Everything players and admins read:
- the map, the navigation widget and turn-by-turn directions
- the speed limit sign
- the help window
- every admin editor and its error messages
- notifications
- key binding names (GTA Settings > Key Bindings > FiveM) and command help
Distances use the language's decimal comma, and the arrival time uses its clock: 24-hour for French, Spanish, German and Dutch.
Want a word changed? You can edit any text yourself in the language file (see below), or tell us in the Discord.
What's not translated
These are yours or the map's, so they stay as they are:
- place names and category names, from
config.luaand the place lists. Write them in your server's language there. - map and region names
- street names and zone names
- postal codes
Server console logs and the /postalimport messages also stay in English. /postalimport is an admin tool that writes to the console too.
The language files
The texts are in the locales folder, one file per language:
mayo_nav/
locales/
en.lua
fr.lua
es.lua
de.lua
nl.luaThese files are open, not escrowed, so you can read and edit them. Each line is one text:
Locales['en'] = {
['postal.title'] = 'Postal {code}',
['postal.renamed'] = 'Postal {code} renamed to {newCode}',
...
}Only change the text on the right, between the quotes. The key on the left ('postal.title') must stay the same.
Adding a language
- Copy
locales/en.luatolocales/<code>.lua, for examplelocales/it.luafor Italian. - At the top of the new file, change
Locales['en']toLocales['it']. - Translate the texts between the quotes.
- Set
Config.Locale = 'it'inconfig.lua. - Restart
mayo_nav.
While translating:
- Keep the
{name}parts as they are. They are filled in by MayoNav, for example{street}becomes Pine Ave and{n}a number. You can move them within the sentence. - Keep the
<b>and</b>tags. They make a word bold, for example the key names in the editor tips. - Keys ending in
_oneare the text for exactly one, for example'{n} road'next to'{n} roads'. - You don't have to do it all at once. A text you leave out shows in English, so you can translate a few at a time.
The new file is picked up on its own, nothing to add to fxmanifest.lua.
Set Config.Locale to a language with no file in locales and MayoNav uses English, with a warning in the server console.
Changing a single text
You can also change a text in one of the built-in languages, for example a word your players use differently. Edit it in that language's file and restart mayo_nav.
A MayoNav update replaces the files in locales. Keep a copy of the files you changed, or of your own language, and put them back after updating.