Skip to content

Commit

Permalink
Merge pull request Project-Sloth#70 from buddizer/patch-1
Browse files Browse the repository at this point in the history
Patch 1
  • Loading branch information
MonkeyWhisper authored Mar 3, 2023
2 parents 2b16d88 + 5af3188 commit 0291cd5
Show file tree
Hide file tree
Showing 20 changed files with 168 additions and 44 deletions.
8 changes: 2 additions & 6 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ RegisterNUICallback('closeMenu', function(_, cb)
SetNuiFocus(false, false)
end)

RegisterKeyMapping('menu', 'Open Menu', 'keyboard', Config.OpenMenu)
RegisterKeyMapping('menu', Lang:t('info.open_menu'), 'keyboard', Config.OpenMenu)

-- Reset hud
local function restartHud()
Expand Down Expand Up @@ -613,10 +613,6 @@ RegisterNUICallback('updateMenuSettingsToClient', function(data, cb)
Menu.isPointerShowChecked = data.isPointerShowChecked
CinematicShow(data.isCineamticModeChecked)
cb({})
if Menu.isMapEnabledChecked then
Wait(50)
TriggerEvent("hud:client:LoadMap")
end
end)

RegisterNetEvent("hud:client:EngineHealth", function(newEngine)
Expand Down Expand Up @@ -738,7 +734,7 @@ RegisterCommand('+engine', function()
SetVehicleEngineOn(vehicle, not GetIsVehicleEngineRunning(vehicle), false, true)
end)

RegisterKeyMapping('+engine', 'Toggle Engine', 'keyboard', 'G')
RegisterKeyMapping('+engine', Lang:t('info.toggle_engine'), 'keyboard', 'G')

local function IsWhitelistedWeaponArmed(weapon)
if weapon then
Expand Down
1 change: 1 addition & 0 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version '2.1.0'
shared_scripts {
'@qb-core/shared/locale.lua',
'locales/en.lua',
'locales/*.lua',
'config.lua',
'uiconfig.lua'
}
Expand Down
9 changes: 8 additions & 1 deletion locales/ar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@ local Translations = {
["stress_removed"] = "الشعور براحة أكبر"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'ar' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/cs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "Cítíš se volněj!"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'cs' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/da.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "Du føles mere afslappet!"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'da' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "Du relaxed!"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'de' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
13 changes: 12 additions & 1 deletion locales/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ local Translations = {
["access_denied"] = "You Are Not Authorized!",
["stress_gain"] = "Feeling More Stressed!",
["stress_removed"] = "Feeling More Relaxed!"
},
info = {
["toggle_engine"] = "Toggle Engine",
["open_menu"] = "Open Menu",
["check_cash_balance"] = "Check Cash Balance",
["check_bank_balance"] = "Check Bank Balance",
["toggle_dev_mode"] = "Enable/Disable developer Mode",
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

Lang = Lang or Locale:new({
phrases = Translations,
warnOnMissing = true
})
46 changes: 30 additions & 16 deletions locales/es.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
local Translations = {
notify = {
["hud_settings_loaded"] = "Configuración de HUD cargada.",
["hud_restart"] = "HUD se está reiniciando.",
["hud_start"] = "HUD funcionando.",
["hud_command_info"] = "Este comando restablece la configuración del HUD",
["load_square_map"] = "Cargando el mapa cuadrado.",
["loaded_square_map"] = "El mapa cuadrado se ha cargado.",
["load_circle_map"] = "Cargando el mapa circular.",
["loaded_circle_map"] = "El mapa circular se ha cargado.",
["cinematic_on"] = "Modo cinematográfico activado!",
["cinematic_off"] = "Modo cinematográfico desactivado.",
["engine_on"] = "¡Motor arrancado!",
["engine_off"] = "Motor apagado.",
["hud_settings_loaded"] = "Configuración de HUD cargada",
["hud_restart"] = "El HUD se está reiniciando...",
["hud_start"] = "El HUD ya está funcionando",
["hud_command_info"] = "Este comando reestablece la configuración actual del HUD",
["load_square_map"] = "Cargando mapa cuadrado...",
["loaded_square_map"] = "El mapa cuadrado se cargó correctamente",
["load_circle_map"] = "Cargando mapa circular...",
["loaded_circle_map"] = "El mapa circular se cargó correctamente",
["cinematic_on"] = "Modo cinematográfico activado",
["cinematic_off"] = "Modo cinematográfico desactivado",
["engine_on"] = "Motor encedido",
["engine_off"] = "Motor apagado",
["low_fuel"] = "¡Nivel de gasolina bajo!",
["access_denied"] = "¿Que haces? ¡No estas autorizado!",
["stress_gain"] = "Te estás sintiéndo más estresado/a.",
["stress_removed"] = "Te estás sintiéndo más relajado/a."
["access_denied"] = "¡No estás autorizado!",
["stress_gain"] = "Te estás sintiéndo más estresado(o)",
["stress_removed"] = "Te estás sintiéndo más relajado(a)"
},
info = {
["toggle_engine"] = "Encender/apagar motor",
["open_menu"] = "Abrir menú",
["check_cash_balance"] = "Revisar balance de efectivo",
["check_bank_balance"] = "Revisar balance de banco",
["toggle_dev_mode"] = "Habilitar/deshabilitar modo desarrollador",
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'es' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/fa.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "Mizan Estres Dar Hale Kahesh Ast!"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'fa' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/fi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "Stressisi on nyt loppunut! Otathan ihan clillisti sit"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'fi' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/fr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "Vous-vous relaxez!"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'fr' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/ge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "თავს გრძნობ რელაქსირებულად!"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'ge' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/it.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "Ti Stai Rilassando!"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'it' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
12 changes: 8 additions & 4 deletions locales/nl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ local Translations = {
["stress_removed"] = "Je voelt je meer relaxed!"
}
}
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true
})

if GetConvar('qb_locale', 'en') == 'nl' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/pl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "Czujesz się bardziej zrelaksowany!"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'pl' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/pt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "A Sentir-me Mais Calmo(a)!"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'pt' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/sk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "Pocituješ uvoľnenie!"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'sk' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "Känner dig mer avslappnad!"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'sv' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
9 changes: 8 additions & 1 deletion locales/tr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@ local Translations = {
["stress_removed"] = "Daha Rahatlamış Hissediyorum!"
}
}
Lang = Locale:new({phrases = Translations, warnOnMissing = true})

if GetConvar('qb_locale', 'en') == 'tr' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
6 changes: 3 additions & 3 deletions server.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
local QBCore = exports['qb-core']:GetCoreObject()
local ResetStress = false

QBCore.Commands.Add('cash', 'Check Cash Balance', {}, false, function(source, args)
QBCore.Commands.Add('cash', Lang:t('info.check_cash_balance'), {}, false, function(source, args)
local Player = QBCore.Functions.GetPlayer(source)
local cashamount = Player.PlayerData.money.cash
TriggerClientEvent('hud:client:ShowAccounts', source, 'cash', cashamount)
end)

QBCore.Commands.Add('bank', 'Check Bank Balance', {}, false, function(source, args)
QBCore.Commands.Add('bank', Lang:t('info.check_bank_balance'), {}, false, function(source, args)
local Player = QBCore.Functions.GetPlayer(source)
local bankamount = Player.PlayerData.money.bank
TriggerClientEvent('hud:client:ShowAccounts', source, 'bank', bankamount)
end)

QBCore.Commands.Add("dev", "Enable/Disable developer Mode", {}, false, function(source, args)
QBCore.Commands.Add("dev", Lang:t('info.toggle_dev_mode'), {}, false, function(source, args)
TriggerClientEvent("qb-admin:client:ToggleDevmode", source)
end, 'admin')

Expand Down

0 comments on commit 0291cd5

Please sign in to comment.