Merge pull request #1 from CaliforniaRP/master

Multi-language support
This commit is contained in:
Jérémie N'gadi
2017-08-16 09:31:20 +02:00
committed by GitHub
5 changed files with 32 additions and 11 deletions
+7 -1
View File
@@ -1,9 +1,15 @@
server_scripts {
'@es_extended/locale.lua',
'locales/en.lua',
'locales/fr.lua',
'@mysql-async/lib/MySQL.lua',
'server/esx_joblisting_sv.lua'
}
client_scripts {
'@es_extended/locale.lua',
'locales/en.lua',
'locales/fr.lua',
'config.lua',
'client/esx_joblisting_cl.lua'
}
}
+10 -10
View File
@@ -21,7 +21,7 @@ function ShowJobListingMenu(data)
local elements = {}
for i = 1, #data, 1 do
table.insert(
elements,
elements,
{label = data[i].label, value = data[i].value}
)
end
@@ -36,7 +36,7 @@ function ShowJobListingMenu(data)
},
function(data, menu)
TriggerServerEvent('esx_joblisting:setJob', data.current.value)
ESX.ShowNotification('Vous avez un nouveau job !')
ESX.ShowNotification(_U('new_job'))
menu.close()
end,
function(data, menu)
@@ -53,9 +53,9 @@ end)
-- Display markers
Citizen.CreateThread(function()
while true do
Wait(0)
local coords = GetEntityCoords(GetPlayerPed(-1))
while true do
Wait(0)
local coords = GetEntityCoords(GetPlayerPed(-1))
for i=1, #Config.Zones, 1 do
if(GetDistanceBetweenCoords(coords, Config.Zones[i].x, Config.Zones[i].y, Config.Zones[i].z, true) < Config.DrawDistance) then
DrawMarker(Config.MarkerType, Config.Zones[i].x, Config.Zones[i].y, Config.Zones[i].z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, Config.ZoneSize.x, Config.ZoneSize.y, Config.ZoneSize.z, Config.MarkerColor.r, Config.MarkerColor.g, Config.MarkerColor.b, 100, false, true, 2, false, false, false, false)
@@ -66,7 +66,7 @@ end)
-- Activate menu when player is inside marker
Citizen.CreateThread(function()
while true do
while true do
Wait(0)
local coords = GetEntityCoords(GetPlayerPed(-1))
isInJoblistingMarker = false
@@ -75,7 +75,7 @@ Citizen.CreateThread(function()
if(GetDistanceBetweenCoords(coords, Config.Zones[i].x, Config.Zones[i].y, Config.Zones[i].z, true) < Config.ZoneSize.x / 2) then
isInJoblistingMarker = true
SetTextComponentFormat('STRING')
AddTextComponentString('Appuyez sur ~INPUT_PICKUP~ pour \naccéder au ~b~Pôle Emploi~s~.')
AddTextComponentString(_U('access_job_center'))
DisplayHelpTextFromStringLabel(0, 0, 1, -1)
end
end
@@ -92,14 +92,14 @@ end)
-- Create blips
Citizen.CreateThread(function()
for i=1, #Config.Zones, 1 do
local blip = AddBlipForCoord(Config.Zones[i].x, Config.Zones[i].y, Config.Zones[i].z)
local blip = AddBlipForCoord(Config.Zones[i].x, Config.Zones[i].y, Config.Zones[i].z)
SetBlipSprite (blip, 407)
SetBlipDisplay(blip, 4)
SetBlipScale (blip, 1.2)
SetBlipColour (blip, 27)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString("Pôle-Emploi")
AddTextComponentString(_U('job_center'))
EndTextCommandSetBlipName(blip)
end
end)
@@ -112,4 +112,4 @@ Citizen.CreateThread(function()
ShowJobListingMenu()
end
end
end)
end)
+1
View File
@@ -3,6 +3,7 @@ Config.DrawDistance = 100.0
Config.ZoneSize = {x = 3.0, y = 3.0, z = 2.0}
Config.MarkerColor = {r = 100, g = 100, b = 204}
Config.MarkerType = 1
Config.Locale = 'fr'
Config.Zones = {
{x = -265.036, y = -963.630, z = 30.223}
+7
View File
@@ -0,0 +1,7 @@
Locales['en'] = {
['new_job'] = 'you have a new job!',
['access_job_center'] = 'press ~INPUT_PICKUP~ to access the ~b~job center~s~.',
['job_center'] = 'job Center',
}
+7
View File
@@ -0,0 +1,7 @@
Locales['fr'] = {
['new_job'] = 'vous avez nouveau job !',
['access_job_center'] = 'appuyez sur ~INPUT_PICKUP~ pour \naccéder au ~b~Pôle Emploi~s~.',
['job_center'] = 'pôle-Emploi',
}