Devices/Languages

Languages

Pick a language, or add your own.

Devices pages

Evolent Devices uses the locale system of ox_lib. Every text players and admins see, in the game, the panel, the Evolent OS and the tablet, comes from the files in locales/.

LanguageFile
Englishlocales/en.json
Spanishlocales/es.json
Frenchlocales/fr.json
Portuguese (Brazil)locales/pt-br.json

Picking a language

Set the ox:locale convar in your server.cfg. It is shared by every resource that uses ox_lib locales:

server.cfg
setr ox:locale "es"

The server uses this language for its console lines and the texts it sends. Each player's game uses the language they picked in the ox_lib settings, which starts from the convar. To give every player the server language, turn the choice off with setr ox:userLocales 0. A key missing from a file falls back to English.

A player who changes their language in the ox_lib settings may see some screens in the old language until they reconnect.

Adding a language

Copy the English file

Copy locales/en.json to a new file named after the ox_lib language code, for example locales/de.json for German or locales/pl.json for Polish.

Translate the values

Translate the text after each key, never the key itself. Keep every placeholder in the same order:

  • %s is a text, such as a device name or a player name.
  • %d is a whole number.
  • %% is a percent sign.
locales/de.json
{
  "reason_device_in_use": "Jemand benutzt dieses Gerät gerade.",
  "item_placed": "%s aufgestellt."
}

Some keys are lists the OS splits at the commas, such as os_weekdays (seven days, starting with Sunday) and os_months (twelve months). Keep the same number of items.

Restart

With nobody on the server, run refresh, then ensure evolent_devices, and set ox:locale to the new code.

Use plain characters

Don't use middle dots or long dashes in the texts, and avoid ${...}: ox_lib replaces it with another locale key.

If you made a language others can use, open a pull request on GitHub.