Update multi-language support

This commit is contained in:
nearbyplayer
2017-08-18 19:27:05 -04:00
parent 71c8a2c526
commit 4a723faf85
3 changed files with 47 additions and 43 deletions
+41 -41
View File
@@ -1,12 +1,12 @@
DoScreenFadeIn(0) DoScreenFadeIn(0)
local Keys = { local Keys = {
["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57, ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177, ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18, ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182, ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81, ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70, ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178, ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118 ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
@@ -33,8 +33,8 @@ end)
function RespawnPed(ped, coords) function RespawnPed(ped, coords)
SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false, true) SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z, false, false, false, true)
NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, coords.heading, true, false) NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, coords.heading, true, false)
SetPlayerInvincible(ped, false) SetPlayerInvincible(ped, false)
TriggerEvent('playerSpawned', coords.x, coords.y, coords.z, coords.heading) TriggerEvent('playerSpawned', coords.x, coords.y, coords.z, coords.heading)
ClearPedBloodDamage(ped) ClearPedBloodDamage(ped)
ESX.UI.Menu.CloseAll() ESX.UI.Menu.CloseAll()
@@ -45,12 +45,12 @@ function StartRespawnToHospitalMenuTimer()
ESX.SetTimeout(Config.MenuRespawnToHospitalDelay, function() ESX.SetTimeout(Config.MenuRespawnToHospitalDelay, function()
Citizen.Trace('menu should appear') Citizen.Trace('menu should appear')
if IsDead then if IsDead then
local elements = {} local elements = {}
table.insert(elements, {label = 'OUI', value = 'yes'}) table.insert(elements, {label = _U('yes'), value = 'yes'})
ESX.UI.Menu.Open( ESX.UI.Menu.Open(
'default', GetCurrentResourceName(), 'menuName', 'default', GetCurrentResourceName(), 'menuName',
@@ -63,13 +63,13 @@ function StartRespawnToHospitalMenuTimer()
menu.close() menu.close()
Citizen.CreateThread(function() Citizen.CreateThread(function()
DoScreenFadeOut(800) DoScreenFadeOut(800)
while not IsScreenFadedOut() do while not IsScreenFadedOut() do
Citizen.Wait(0) Citizen.Wait(0)
end end
ESX.TriggerServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function() ESX.TriggerServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function()
TriggerServerEvent('esx:updateLastPosition', Config.Zones.HospitalInteriorInside1.Pos) TriggerServerEvent('esx:updateLastPosition', Config.Zones.HospitalInteriorInside1.Pos)
@@ -88,8 +88,8 @@ function StartRespawnToHospitalMenuTimer()
--print(data.current.value) --print(data.current.value)
end end
) )
end end
end) end)
@@ -99,17 +99,17 @@ end
function StartRespawnTimer() function StartRespawnTimer()
ESX.SetTimeout(Config.RespawnDelayAfterRPDeath, function() ESX.SetTimeout(Config.RespawnDelayAfterRPDeath, function()
if IsDead then if IsDead then
Citizen.CreateThread(function() Citizen.CreateThread(function()
DoScreenFadeOut(800) DoScreenFadeOut(800)
while not IsScreenFadedOut() do while not IsScreenFadedOut() do
Citizen.Wait(0) Citizen.Wait(0)
end end
ESX.TriggerServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function() ESX.TriggerServerCallback('esx_ambulancejob:removeItemsAfterRPDeath', function()
TriggerServerEvent('esx:updateLastPosition', Config.Zones.HospitalInteriorInside1.Pos) TriggerServerEvent('esx:updateLastPosition', Config.Zones.HospitalInteriorInside1.Pos)
@@ -129,9 +129,9 @@ end
function TeleportFadeEffect(entity, coords) function TeleportFadeEffect(entity, coords)
Citizen.CreateThread(function() Citizen.CreateThread(function()
DoScreenFadeOut(800) DoScreenFadeOut(800)
while not IsScreenFadedOut() do while not IsScreenFadedOut() do
Citizen.Wait(0) Citizen.Wait(0)
end end
@@ -255,7 +255,7 @@ function OpenAmbulanceActionsMenu()
end, end,
function(data, menu) function(data, menu)
menu.close() menu.close()
CurrentAction = 'ambulance_actions_menu' CurrentAction = 'ambulance_actions_menu'
@@ -313,7 +313,7 @@ function OpenMobileAmbulanceActionsMenu()
local closestPlayerPed = GetPlayerPed(closestPlayer) local closestPlayerPed = GetPlayerPed(closestPlayer)
Citizen.CreateThread(function() Citizen.CreateThread(function()
ESX.ShowNotification(_U('revive_inprogress')) ESX.ShowNotification(_U('revive_inprogress'))
TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true) TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true)
@@ -334,7 +334,7 @@ function OpenMobileAmbulanceActionsMenu()
end end
end end
end end
if data.current.value == 'put_in_vehicle' then if data.current.value == 'put_in_vehicle' then
@@ -371,11 +371,11 @@ function OpenCloakroomMenu()
}, },
}, },
function(data, menu) function(data, menu)
menu.close() menu.close()
if data.current.value == 'citizen_wear' then if data.current.value == 'citizen_wear' then
ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin) ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
TriggerEvent('skinchanger:loadSkin', skin) TriggerEvent('skinchanger:loadSkin', skin)
end) end)
@@ -391,7 +391,7 @@ function OpenCloakroomMenu()
else else
TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female) TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female)
end end
end) end)
end end
@@ -421,7 +421,7 @@ function OpenVehicleSpawnerMenu()
}, },
}, },
function(data, menu) function(data, menu)
menu.close() menu.close()
local model = data.current.value local model = data.current.value
@@ -441,7 +441,7 @@ function OpenVehicleSpawnerMenu()
end, end,
function(data, menu) function(data, menu)
menu.close() menu.close()
CurrentAction = 'vehicle_spawner_menu' CurrentAction = 'vehicle_spawner_menu'
@@ -544,13 +544,13 @@ AddEventHandler('esx_ambulancejob:revive', function()
local coords = GetEntityCoords(playerPed) local coords = GetEntityCoords(playerPed)
Citizen.CreateThread(function() Citizen.CreateThread(function()
DoScreenFadeOut(800) DoScreenFadeOut(800)
while not IsScreenFadedOut() do while not IsScreenFadedOut() do
Citizen.Wait(0) Citizen.Wait(0)
end end
TriggerServerEvent('esx:updateLastPosition', { TriggerServerEvent('esx:updateLastPosition', {
x = coords.x, x = coords.x,
y = coords.y, y = coords.y,
@@ -602,7 +602,7 @@ AddEventHandler('esx_ambulancejob:hasEnteredMarker', function(zone)
end end
if zone == 'VehicleDeleter' and PlayerData.job ~= nil and PlayerData.job.name == 'ambulance' then if zone == 'VehicleDeleter' and PlayerData.job ~= nil and PlayerData.job.name == 'ambulance' then
local playerPed = GetPlayerPed(-1) local playerPed = GetPlayerPed(-1)
local coords = GetEntityCoords(playerPed) local coords = GetEntityCoords(playerPed)
@@ -637,12 +637,12 @@ end)
Citizen.CreateThread(function() Citizen.CreateThread(function()
local blip = AddBlipForCoord(Config.Zones.HospitalInteriorOutside1.Pos.x, Config.Zones.HospitalInteriorOutside1.Pos.y, Config.Zones.HospitalInteriorOutside1.Pos.z) local blip = AddBlipForCoord(Config.Zones.HospitalInteriorOutside1.Pos.x, Config.Zones.HospitalInteriorOutside1.Pos.y, Config.Zones.HospitalInteriorOutside1.Pos.z)
SetBlipSprite (blip, 61) SetBlipSprite (blip, 61)
SetBlipDisplay(blip, 4) SetBlipDisplay(blip, 4)
SetBlipScale (blip, 1.2) SetBlipScale (blip, 1.2)
SetBlipAsShortRange(blip, true) SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING") BeginTextCommandSetBlipName("STRING")
AddTextComponentString(_U('hospital')) AddTextComponentString(_U('hospital'))
EndTextCommandSetBlipName(blip) EndTextCommandSetBlipName(blip)
@@ -652,11 +652,11 @@ end)
-- Display markers -- Display markers
Citizen.CreateThread(function() Citizen.CreateThread(function()
while true do while true do
Wait(0) Wait(0)
local coords = GetEntityCoords(GetPlayerPed(-1)) local coords = GetEntityCoords(GetPlayerPed(-1))
for k,v in pairs(Config.Zones) do for k,v in pairs(Config.Zones) do
if(v.Type ~= -1 and GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.DrawDistance) then if(v.Type ~= -1 and GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.DrawDistance) then
@@ -670,8 +670,8 @@ end)
-- Activate menu when player is inside marker -- Activate menu when player is inside marker
Citizen.CreateThread(function() Citizen.CreateThread(function()
while true do while true do
Wait(0) Wait(0)
local coords = GetEntityCoords(GetPlayerPed(-1)) local coords = GetEntityCoords(GetPlayerPed(-1))
local isInMarker = false local isInMarker = false
@@ -711,7 +711,7 @@ Citizen.CreateThread(function()
DisplayHelpTextFromStringLabel(0, 0, 1, -1) DisplayHelpTextFromStringLabel(0, 0, 1, -1)
if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'ambulance' and (GetGameTimer() - GUI.Time) > 150 then if IsControlPressed(0, Keys['E']) and PlayerData.job ~= nil and PlayerData.job.name == 'ambulance' and (GetGameTimer() - GUI.Time) > 150 then
if CurrentAction == 'ambulance_actions_menu' then if CurrentAction == 'ambulance_actions_menu' then
OpenAmbulanceActionsMenu() OpenAmbulanceActionsMenu()
end end
@@ -726,7 +726,7 @@ Citizen.CreateThread(function()
CurrentAction = nil CurrentAction = nil
GUI.Time = GetGameTimer() GUI.Time = GetGameTimer()
end end
end end
@@ -744,4 +744,4 @@ Citizen.CreateThread(function()
LoadMpDlcMaps() LoadMpDlcMaps()
EnableMpDlcMaps(true) EnableMpDlcMaps(true)
RequestIpl('Coroner_Int_on') -- Morgue RequestIpl('Coroner_Int_on') -- Morgue
end) end)
+4 -1
View File
@@ -32,4 +32,7 @@ Locales['en'] = {
['ems_menu_putincar'] = 'put in Vehicle', ['ems_menu_putincar'] = 'put in Vehicle',
-- Phone -- Phone
['alert_ambulance'] = 'alert Ambulance', ['alert_ambulance'] = 'alert Ambulance',
} -- Death
['respawn_at_hospital'] = 'do you want to be tranported to the hospital?',
['yes'] = 'yes',
}
+2 -1
View File
@@ -34,4 +34,5 @@ Locales['fr'] = {
['alert_ambulance'] = 'alerte Ambulance', ['alert_ambulance'] = 'alerte Ambulance',
-- Death -- Death
['respawn_at_hospital'] = 'voulez-vous être transporté à l\'hôpital ?', ['respawn_at_hospital'] = 'voulez-vous être transporté à l\'hôpital ?',
} ['yes'] = 'oui',
}