Language files
The texts of the job offer window and some script messages are stored in JSON files in the shared/lang folder of the ares_electrician resource. One file, en.json (English), is included.
Config.Language in config.lua selects the file. The value is the file name without .json:
Config.Language = 'en'File structure
Section titled “File structure”Each file has two sections. Both must be present.
| Section | Contains |
|---|---|
front_end |
Texts of the interface windows (the job offer window and minigame titles). |
back_end |
Texts of script notifications, errors, job types and general titles. |
Edit the English text
Section titled “Edit the English text”- Open
shared/lang/en.json. - Change only the text on the right side of each key.
- Save the file.
- Restart the resource with
restart ares_electrician.
Add a new language
Section titled “Add a new language”-
Copy
shared/lang/en.jsonand name the copy after your language, for exampleshared/lang/fr.json. -
Translate the values (the text on the right side). Do not change the keys on the left side.
-
In
config.lua, set the language code to the new file name without.json:Config.Language = 'fr' -
Restart the resource with
restart ares_electrician.
Rules for the file
Section titled “Rules for the file”- Do not rename or remove any key.
- Keep the file valid JSON: double quotes around keys and texts, a comma after every entry except the last one in a block.
- Keep
%dinjob_completedandjob_failed. The script replaces it with the payment amount. - Save the file as UTF-8 so accented characters show correctly.
- Keep
en.jsonin the folder. If your language file is missing, has a typo in the language code or contains invalid JSON, the script falls back to English.
Key reference
Section titled “Key reference”front_end.notification
Section titled “front_end.notification”This is the job offer window. All keys are used.
| Key | Default text | Where it shows |
|---|---|---|
dispatch_role |
Dispatch |
Role label under the dispatcher name. |
job_details_title |
Job Details |
Title of the details block. |
distance_label |
Distance |
Label for the distance to the site. |
pay_label |
Pay |
Label for the pay. |
difficulty_label |
Difficulty |
Label for the difficulty. |
difficulty_easy |
Easy |
Difficulty name for easy. |
difficulty_medium |
Medium |
Difficulty name for medium. |
difficulty_hard |
Hard |
Difficulty name for hard. |
btn_end_job |
End the job |
Button that ends the job. |
btn_reroll |
Reroll |
Button that asks for a different job. |
btn_take_job |
Take the job |
Button that accepts the job. |
dispatcher_default_name |
Dispatch Center |
Name of the dispatcher. |
The file has no text for the expert difficulty. Sites with difficulty = "expert" still work and keep their pay multiplier.
front_end.minigame
Section titled “front_end.minigame”| Key | Default text |
|---|---|
circuit_panel.title |
Circuit Panel Repair |
circuit_panel.instructions |
Connect the power lines correctly |
wiring.title |
Wire Repair |
wiring.instructions |
Fix the damaged wiring |
These entries are loaded, but the minigame windows do not show them in version 1.2.2. Translating them is harmless.
back_end.general
Section titled “back_end.general”| Key | Default text | Where it shows |
|---|---|---|
job_title |
Electrician Job |
Title of several script notifications. Used. |
context |
Get inside the electrician van to get the job started ! |
Not shown in 1.2.2. |
back_end.notifications
Section titled “back_end.notifications”None of these entries are shown in version 1.2.2. They are loaded and kept for later use.
| Key | Default text |
|---|---|
job_started |
Electrician job started! Enter your work van to access dispatch. |
job_ended |
Electrician job ended. |
job_completed |
Job completed! Payment: $%d |
job_failed |
Job failed! Partial payment: $%d |
no_vehicle |
Failed to spawn work vehicle! Try again in a moment. |
vehicle_spawn_failed |
Failed to spawn work vehicle! Try again in a moment. |
parking_occupied |
All parking spaces are occupied! Please try again in a moment. |
arrived_at_site |
You have arrived at the job site. Look for electrical panels to repair. |
back_end.errors
Section titled “back_end.errors”None of these entries are shown in version 1.2.2.
| Key | Default text |
|---|---|
already_on_job |
You already have an active job! |
not_on_job |
You are not on a job |
no_call_active |
You don't have an active call |
config_invalid |
Invalid configuration |
vehicles_destroyed |
All vehicles destroyed - job terminated |
force_ended |
Job has been force ended |
back_end.job_types
Section titled “back_end.job_types”None of these entries are shown in version 1.2.2.
| Key | Default text |
|---|---|
residential_repair |
Residential Electrical Repair |
commercial_maintenance |
Commercial Maintenance |
emergency_callout |
Emergency Callout |
panel_upgrade |
Panel Upgrade |
Texts you cannot change in the language file
Section titled “Texts you cannot change in the language file”The following texts are part of the script and are not read from the language files in version 1.2.2:
- The target labels (for example Start Electrician Job and Enter Work Van).
- The help texts at a site (for example “Press E to repair electrical system”).
- Most notification messages (job accepted, job completed with payout, lobby messages, minigame result, errors).
- The
ox_libdispatch menu texts used whenConfig.menu = 'ox_lib'.
Names that you set in config.lua, such as the job center blip name, the site names and the site descriptions, are plain text. Write them in your own language directly in the config.
