diff --git a/__resource.lua b/__resource.lua index 7993f10f..30e27ff6 100644 --- a/__resource.lua +++ b/__resource.lua @@ -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' -} \ No newline at end of file +} diff --git a/client/esx_joblisting_cl.lua b/client/esx_joblisting_cl.lua index e782aa7e..2ae6c0a0 100644 --- a/client/esx_joblisting_cl.lua +++ b/client/esx_joblisting_cl.lua @@ -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) \ No newline at end of file +end) diff --git a/config.lua b/config.lua index 876c8df9..8648b3db 100644 --- a/config.lua +++ b/config.lua @@ -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} diff --git a/locales/en.lua b/locales/en.lua new file mode 100644 index 00000000..a07a80a2 --- /dev/null +++ b/locales/en.lua @@ -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', + +} diff --git a/locales/fr.lua b/locales/fr.lua new file mode 100644 index 00000000..60217531 --- /dev/null +++ b/locales/fr.lua @@ -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', + +}