Multi-Language support

Added multi-language support
This commit is contained in:
Don
2017-08-14 15:06:48 -07:00
parent cc43d95ca6
commit f175149adf
6 changed files with 38 additions and 18 deletions
+19 -12
View File
@@ -1,18 +1,25 @@
description 'ESX ATM'
server_script{
'@es_extended/locale.lua',
'locales/en.lua',
'locales/fr.lua',
'config.lua',
'server/esx_atm_sv.lua'
}
server_script 'server/esx_atm_sv.lua'
client_script {
'config.lua',
'client/esx_atm_cl.lua'
client_script{
'@es_extended/locale.lua',
'locales/en.lua',
'locales/fr.lua',
'config.lua',
'client/esx_atm_cl.lua'
}
ui_page 'html/ui.html'
files {
'html/ui.html',
'html/pdown.ttf',
'html/img/cursor.png',
'html/css/app.css',
'html/scripts/app.js'
files{
'html/ui.html',
'html/pdown.ttf',
'html/img/cursor.png',
'html/css/app.css',
'html/scripts/app.js'
}
+1 -1
View File
@@ -74,7 +74,7 @@ Citizen.CreateThread(function()
if(GetDistanceBetweenCoords(coords, Config.ATMS[i].x, Config.ATMS[i].y, Config.ATMS[i].z, true) < Config.ZoneSize.x / 2) then
isInATMMarker = true
SetTextComponentFormat('STRING')
AddTextComponentString('Appuyez sur ~INPUT_PICKUP~ pour déposer ou retirer du ~g~cash~s~.')
AddTextComponentString(_U('press_e_atm'))
DisplayHelpTextFromStringLabel(0, 0, 1, -1)
end
end
+2 -1
View File
@@ -5,8 +5,9 @@ Config.ZoneSize = {x = 3.0, y = 3.0, z = 0.3}
Config.MarkerColor = {r = 100, g = 100, b = 204}
Config.ZDiff = 2.0
Config.BlipSprite = 431
Config.Locale = 'fr'
Config.ATMS = {
Config.ATMS = {
{ ['x'] = -386.733, ['y'] = 6045.953, ['z'] = 31.501},
{ ['x'] = -110.753, ['y'] = 6467.703, ['z'] = 31.784},
{ ['x'] = 155.4300, ['y'] = 6641.991, ['z'] = 31.784},
+6
View File
@@ -0,0 +1,6 @@
Locales['en'] = {
['invalid_amount'] = '~r~invalid amount',
['deposit_money'] = 'you have deposited ~g~$',
['withdraw_money'] = 'you withdrawn ~g~$',
['press_e_atm'] = 'press sure ~INPUT_PICKUP~ for deposit or withdraw from ~g~ATM~s~.',
}
+6
View File
@@ -0,0 +1,6 @@
Locales['fr'] = {
['invalid_amount'] = '~r~montant invalide',
['deposit_money'] = 'vous avez déposé ~g~$',
['withdraw_money'] = 'vous avez retiré ~g~$',
['press_e_atm'] = 'appuyez sur ~INPUT_PICKUP~ pour déposer ou retirer du ~g~cash~s~.',
}
+4 -4
View File
@@ -7,11 +7,11 @@ AddEventHandler('esx_atm:deposit', function(amount)
local xPlayer = ESX.GetPlayerFromId(_source)
amount = tonumber(amount)
if amount == nil or amount <= 0 or amount > xPlayer.getMoney() then
TriggerClientEvent('esx:showNotification', _source, '~r~Montant invalide')
TriggerClientEvent('esx:showNotification', _source, _U('invalid_amount'))
else
xPlayer.removeMoney(amount)
xPlayer.addAccountMoney('bank', amount)
TriggerClientEvent('esx:showNotification', _source, 'Vous avez déposé ~g~' .. amount .. '$~s~.')
TriggerClientEvent('esx:showNotification', _source, _U('deposit_money') .. amount .. '~s~.')
TriggerClientEvent('esx_atm:closeATM', _source)
end
end)
@@ -25,11 +25,11 @@ AddEventHandler('esx_atm:withdraw', function(amount)
local accountMoney = 0
accountMoney = xPlayer.getAccount('bank').money
if amount == nil or amount <= 0 or amount > accountMoney then
TriggerClientEvent('esx:showNotification', _source, '~r~Montant invalide')
TriggerClientEvent('esx:showNotification', _source, _U('invalid_amount'))
else
xPlayer.removeAccountMoney('bank', amount)
xPlayer.addMoney(amount)
TriggerClientEvent('esx:showNotification', _source, 'Vous avez retiré ~g~' .. amount .. '$~s~.')
TriggerClientEvent('esx:showNotification', _source, _U('withdraw_money') .. amount .. '~s~.')
TriggerClientEvent('esx_atm:closeATM', _source)
end
end)