Multi-language support

This commit is contained in:
nearbyplayer
2017-08-16 20:50:15 -04:00
parent dd5f4f64ab
commit cdab4fb686
5 changed files with 36 additions and 8 deletions
+8
View File
@@ -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'
}
+2
View File
@@ -0,0 +1,2 @@
Config = {}
Config.Locale = 'fr'
+9
View File
@@ -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~$',
}
+9
View File
@@ -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~$',
}
+8 -8
View File
@@ -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)
TriggerEvent('cron:runAt', 3, 0, WashMoneyCRON)