Available languages
The following languages are officially included with each script:- 🇪🇸 Español (
es) - 🇬🇧 English (
en) - 🇫🇷 Français (
fr) - 🇩🇪 Deutsch (
de) - 🇧🇷 Português (
pt)
Change the language
To change the script language, openshared/config.lua and update the Config.Locale value with the code of the language you want:
shared/config.lua
restart resource_name) for the change to take effect. The script will automatically load the corresponding file in the locales/ folder.
Localization file structure
Each language has its own file inside thelocales/ folder. Its structure is simple: a Locales table where each key is an internal identifier and its value is the text the player will see.
locales/es.lua
Placeholders %s
Some texts contain the %s placeholder, which the script replaces at runtime with a dynamic value. For example, in notify_cooldown the %s will be replaced by the remaining cooldown seconds. You can move the placeholder within the sentence to adapt it to your language grammar, but do not remove it if it appears in the original, as the script needs it to insert that data.
Create a custom translation
If you want to use a language that is not included or customize existing texts, follow these steps:1
Duplicate an existing localization file
Copy a file from a language that will serve as a base, for example
locales/es.lua, and rename it with the code of your new language:2
Edit the values keeping the keys intact
Open
locales/my_language.lua and translate only the right-hand part of each line (the text in quotes). Do not modify the key names (the left-hand part, such as notify_success), as the script uses them to look up texts internally.locales/my_language.lua
3
Update Config.Locale in config.lua
Tell the script to load your new localization file:
shared/config.lua
4
Restart the resource
Apply the changes by restarting the resource from the server console:Verify that the in-game texts appear in the new language. If any text still shows in the previous language, check that the file name matches exactly the value of
Config.Locale.