From 3cfae095036b97f0c668b1762b02e93a7dddb935 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 25 Nov 2018 16:02:22 +0100 Subject: [PATCH] Fixed hardcoded dollar sign, group money --- client/main.lua | 24 +++++++++++++++++------- locales/en.lua | 1 + locales/fi.lua | 3 ++- locales/fr.lua | 1 + locales/pl.lua | 1 + locales/sv.lua | 1 + server/main.lua | 13 ++++++------- 7 files changed, 29 insertions(+), 15 deletions(-) diff --git a/client/main.lua b/client/main.lua index 2a87d683..45cd67c2 100644 --- a/client/main.lua +++ b/client/main.lua @@ -23,7 +23,7 @@ end function UpdateSocietyMoneyHUDElement(money) ESX.UI.HUD.UpdateElement('society_money', { - money = money + money = ESX.Math.GroupDigits(money) }) end @@ -87,8 +87,7 @@ function OpenBossMenu(society, close, options) if data.current.value == 'withdraw_society_money' then - ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'withdraw_society_money_amount_' .. society, - { + ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'withdraw_society_money_amount_' .. society, { title = _U('withdraw_amount') }, function(data, menu) @@ -167,7 +166,7 @@ function OpenManageEmployeesMenu(society) align = 'top-left', elements = { {label = _U('employee_list'), value = 'employee_list'}, - {label = _U('recruit'), value = 'recruit'}, + {label = _U('recruit'), value = 'recruit'} } }, function(data, menu) @@ -242,7 +241,12 @@ function OpenRecruitMenu(society) for i=1, #players, 1 do if players[i].job.name ~= society then - table.insert(elements, {label = players[i].name, value = players[i].source, name = players[i].name, identifier = players[i].identifier}) + table.insert(elements, { + label = players[i].name, + value = players[i].source, + name = players[i].name, + identifier = players[i].identifier + }) end end @@ -295,7 +299,12 @@ function OpenPromoteMenu(society, employee) for i=1, #job.grades, 1 do local gradeLabel = (job.grades[i].label == '' and job.label or job.grades[i].label) - table.insert(elements, {label = gradeLabel, value = job.grades[i].grade, selected = (employee.job.grade == job.grades[i].grade)}) + + table.insert(elements, { + label = gradeLabel, + value = job.grades[i].grade, + selected = (employee.job.grade == job.grades[i].grade) + }) end ESX.UI.Menu.Open('default', GetCurrentResourceName(), 'promote_employee_' .. society, @@ -329,8 +338,9 @@ function OpenManageGradesMenu(society) for i=1, #job.grades, 1 do local gradeLabel = (job.grades[i].label == '' and job.label or job.grades[i].label) + table.insert(elements, { - label = (string.format ('%s - $%i', gradeLabel, job.grades[i].salary)), + label = ('%s - %s'):format(gradeLabel, _U('money_generic', ESX.Math.GroupDigits(job.grades[i].salary))), value = job.grades[i].grade }) end diff --git a/locales/en.lua b/locales/en.lua index 7e846366..bcba597f 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -1,6 +1,7 @@ Locales['en'] = { ['actions'] = 'actions', ['boss_menu'] = 'boss menu', + ['money_generic'] = '$%s', ['deposit_amount'] = 'deposit amount', ['deposit_society_money'] = 'deposit society money', ['do_you_want_to_recruit'] = 'do you want to recruit %s?', diff --git a/locales/fi.lua b/locales/fi.lua index a940e5b5..d5283c27 100644 --- a/locales/fi.lua +++ b/locales/fi.lua @@ -1,6 +1,7 @@ Locales['fi'] = { ['actions'] = 'toiminnot', ['boss_menu'] = 'boss menu', + ['money_generic'] = '€%s', ['deposit_amount'] = 'talletus summa', ['deposit_society_money'] = 'talleta yritykselle rahaa', ['do_you_want_to_recruit'] = 'do you want to recruit %s?', @@ -25,7 +26,7 @@ Locales['fi'] = { ['withdraw_amount'] = 'nostettava määrä', ['withdraw_society_money'] = 'nosta yrityksen rahoja', ['yes'] = 'kyllä', - ['you_have'] = 'you have ~g~$%s~s~ waiting in ~y~money laundering~s~ (24h).', + ['you_have'] = 'you have ~g~€%s~s~ waiting in ~y~money laundering~s~ (24h).', ['you_have_laundered'] = 'olet ~r~pessyt~s~ rahojasi: ~g~€%s~s~', ['you_have_hired'] = 'sinä palkkasit henkilön %s', ['you_have_been_hired'] = 'sinut on palkattu pelaajan %s toimesta', diff --git a/locales/fr.lua b/locales/fr.lua index 00145fd8..ad90c3a8 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -1,6 +1,7 @@ Locales['fr'] = { ['actions'] = 'actions', ['boss_menu'] = 'patron', + ['money_generic'] = '$%s', ['deposit_amount'] = 'montant du dépôt', ['deposit_society_money'] = 'déposer argent société', ['do_you_want_to_recruit'] = 'Voulez-vous recruter %s?', diff --git a/locales/pl.lua b/locales/pl.lua index 3eb2883b..f314b4b3 100644 --- a/locales/pl.lua +++ b/locales/pl.lua @@ -1,6 +1,7 @@ Locales['pl'] = { ['actions'] = 'akcje', ['boss_menu'] = 'boss menu', + ['money_generic'] = '$%s', ['deposit_amount'] = 'ilość depozytu', ['deposit_society_money'] = 'zdeponuj społeczne pieniądze', ['do_you_want_to_recruit'] = 'czy chcesz zrekrutować %s?', diff --git a/locales/sv.lua b/locales/sv.lua index a68653f3..42faccb1 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -1,6 +1,7 @@ Locales['sv'] = { ['actions'] = 'handlingar', ['boss_menu'] = 'chefmeny', + ['money_generic'] = '%s SEK', ['deposit_amount'] = 'insättningsbelopp', ['deposit_society_money'] = 'insätt samhälls pengar', ['do_you_want_to_recruit'] = 'vill du anställa %s?', diff --git a/server/main.lua b/server/main.lua index 227b9e2d..0bcad877 100644 --- a/server/main.lua +++ b/server/main.lua @@ -70,7 +70,7 @@ AddEventHandler('esx_society:withdrawMoney', function(society, amount) account.removeMoney(amount) xPlayer.addMoney(amount) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn', amount)) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn', ESX.Math.GroupDigits(amount))) else TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_amount')) end @@ -89,7 +89,7 @@ AddEventHandler('esx_society:depositMoney', function(society, amount) account.addMoney(amount) end) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited', amount)) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited', ESX.Math.GroupDigits(amount))) else TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_amount')) @@ -111,7 +111,7 @@ AddEventHandler('esx_society:washMoney', function(society, amount) ['@society'] = society, ['@amount'] = amount }, function(rowsChanged) - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have', amount)) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have', ESX.Math.GroupDigits(amount))) end) else @@ -236,7 +236,7 @@ ESX.RegisterServerCallback('esx_society:setJob', function(source, cb, identifier if xTarget ~= nil then xTarget.setJob(job, grade) - + if type == 'hire' then TriggerClientEvent('esx:showNotification', xTarget.source, _U('you_have_been_hired', job)) elseif type == 'promote' then @@ -334,11 +334,10 @@ function WashMoneyCRON(d, h, m) -- send notification if player is online local xPlayer = ESX.GetPlayerFromIdentifier(result[i].identifier) if xPlayer ~= nil then - TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have_laundered', result[i].amount)) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have_laundered', ESX.Math.GroupDigits(result[i].amount))) end - MySQL.Async.execute('DELETE FROM society_moneywash WHERE id = @id', - { + MySQL.Async.execute('DELETE FROM society_moneywash WHERE id = @id', { ['@id'] = result[i].id }) end