diff --git a/__resource.lua b/__resource.lua index 9287ed13..bf87ae44 100644 --- a/__resource.lua +++ b/__resource.lua @@ -4,9 +4,17 @@ description 'ESX Society' server_scripts { '@mysql-async/lib/MySQL.lua', + '@es_extended/locale.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'config.lua', 'server/main.lua' } client_scripts { + '@es_extended/locale.lua', + 'locales/en.lua', + 'locales/fr.lua', + 'config.lua', 'client/main.lua' } diff --git a/config.lua b/config.lua new file mode 100644 index 00000000..56a8b5e9 --- /dev/null +++ b/config.lua @@ -0,0 +1,2 @@ +Config = {} +Config.Locale = 'fr' diff --git a/locales/en.lua b/locales/en.lua new file mode 100644 index 00000000..90ecab88 --- /dev/null +++ b/locales/en.lua @@ -0,0 +1,9 @@ +Locales['en'] = { + + ['have_withdrawn'] = 'you have withdrawn ~g~$', + ['invalid_amount'] = 'invalid amount', + ['have_deposited'] = 'you have deposited ~r~$', + ['you_have'] = 'you have ~g~$', + ['you_have_laundered'] = 'you have ~r~laundered~s~ your money: ~g~$', + +} diff --git a/locales/fr.lua b/locales/fr.lua new file mode 100644 index 00000000..6004ee9b --- /dev/null +++ b/locales/fr.lua @@ -0,0 +1,9 @@ +Locales['fr'] = { + + ['have_withdrawn'] = 'vous avez retiré ~g~$', + ['invalid_amount'] = 'montant invalide', + ['have_deposited'] = 'vous avez déposé ~r~$', + ['you_have'] = 'vous avez ~g~$', + ['you_have_laundered'] = 'Vous avez ~r~blanchi~s~ votre argent : ~g~$', + +} diff --git a/server/main.lua b/server/main.lua index 0e30cf2e..29726b19 100644 --- a/server/main.lua +++ b/server/main.lua @@ -14,10 +14,10 @@ AddEventHandler('esx_society:withdrawMoney', function(society, amount) account.removeMoney(amount) xPlayer.addMoney(amount) - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez retiré ~g~$' .. amount) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_withdrawn') .. amount) else - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Montant invalide') + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_amount')) end end) @@ -36,10 +36,10 @@ AddEventHandler('esx_society:depositMoney', function(society, amount) account.addMoney(amount) end) - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez déposé ~r~$' .. amount) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('have_deposited') .. amount) else - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Montant invalide') + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_amount')) end end) @@ -62,12 +62,12 @@ AddEventHandler('esx_society:washMoney', function(society, amount) ['@amount'] = amount }, function(rowsChanged) - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez ~g~$' .. amount .. '~s~ en attente de ~r~blanchiement~s~ (24h)') + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have') .. amount .. '~s~ en attente de ~r~blanchiement~s~ (24h)') end ) else - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Montant invalide') + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('invalid_amount')) end end) @@ -104,7 +104,7 @@ function WashMoneyCRON(d, h, m) end) if foundPlayer then - TriggerClientEvent('esx:showNotification', xPlayer.source, 'Vous avez ~r~blanchi~s~ votre argent : ~g~$' .. result[i].amount) + TriggerClientEvent('esx:showNotification', xPlayer.source, _U('you_have_laundered') .. result[i].amount) end MySQL.Async.execute( @@ -121,4 +121,4 @@ function WashMoneyCRON(d, h, m) end -TriggerEvent('cron:runAt', 3, 0, WashMoneyCRON) \ No newline at end of file +TriggerEvent('cron:runAt', 3, 0, WashMoneyCRON)