Reference
Languages
Five built-in languages (EN/ES/FR/DE/PT) and how to add or edit one through the open locale files.
PSTUDIOS-HUD ships with five languages out of the box. You pick one with Config.Locale and you can edit or add more, because the locale files are left open under escrow.
Built-in languages
- English ('en')
- Spanish / Espanol ('es')
- French / Francais ('fr')
- German / Deutsch ('de')
- Portuguese / Portugues ('pt')
Set the active language in config.lua. The default value is 'es'. See Configuration (config.lua) for where this option lives.
Config.Locale = 'es' -- 'es' / 'en' / 'fr' / 'de' / 'pt'Editable locale files (escrow_ignore)
When the resource is protected through keymaster escrow, everything is encrypted EXCEPT the files listed in escrow_ignore. The locale files are explicitly left open, so you can translate and add languages without touching protected code.
escrow_ignore {
'config.lua', -- el cliente ajusta todo desde aqui
'locales/*.lua', -- traducciones editables / anadir idiomas
'README.md',
'CHANGELOG.md',
}What can be translated
Each locale file defines two groups of strings: the key-binding descriptions (toggle HUD, seatbelt, cruise control, open settings) and the NUI strings (no-route and waypoint labels, unit labels for km/h, mph and knots, and the settings menu labels). Compass cardinals use the international N/NE/E convention and are not translated.
How to add a new language
- Copy locales/en.lua to locales/xx.lua (replace xx with your language code).
- Translate the strings inside, keeping the keys unchanged.
- Register the new file in fxmanifest.lua under client_scripts.
- Set Config.Locale = 'xx' and restart the resource.
Locales = Locales or {}
Locales['es'] = {
key_togglehud = 'PSTUDIOS-HUD: mostrar/ocultar HUD',
key_seatbelt = 'PSTUDIOS-HUD: cinturon',
key_cruise = 'PSTUDIOS-HUD: control de crucero',
key_menu = 'PSTUDIOS-HUD: abrir ajustes',
nui = {
noRoute = 'SIN RUTA',
waypoint = 'DESTINO',
kmh = 'KM/H', mph = 'MPH', knots = 'NUDOS',
km = 'KM', mi = 'MI', nm = 'MN',
},
}