mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 02:08:55 +00:00
multilanguagesupport
Added multi-language support
This commit is contained in:
+7
-1
@@ -4,11 +4,17 @@ description 'ESX Ambulance Job'
|
||||
|
||||
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'
|
||||
}
|
||||
}
|
||||
+32
-32
@@ -114,7 +114,7 @@ function WarpPedInClosestVehicle(ped)
|
||||
end
|
||||
|
||||
else
|
||||
ESX.ShowNotification('Aucun véhicule à proximité')
|
||||
ESX.ShowNotification(_U('no_vehicles'))
|
||||
end
|
||||
|
||||
end
|
||||
@@ -122,12 +122,12 @@ end
|
||||
function OpenAmbulanceActionsMenu()
|
||||
|
||||
local elements = {
|
||||
{label = 'Vestiaire', value = 'cloakroom'}
|
||||
{label = _U('cloakroom'), value = 'cloakroom'}
|
||||
}
|
||||
|
||||
if Config.EnablePlayerManagement and PlayerData.job.grade_name == 'boss' then
|
||||
table.insert(elements, {label = 'Retirer argent société', value = 'withdraw_society_money'})
|
||||
table.insert(elements, {label = 'Déposer argent', value = 'deposit_society_money'})
|
||||
table.insert(elements, {label = _U('withdraw_society'), value = 'withdraw_society_money'})
|
||||
table.insert(elements, {label = _U('deposit_society'), value = 'deposit_society_money'})
|
||||
end
|
||||
|
||||
ESX.UI.Menu.CloseAll()
|
||||
@@ -135,7 +135,7 @@ function OpenAmbulanceActionsMenu()
|
||||
ESX.UI.Menu.Open(
|
||||
'default', GetCurrentResourceName(), 'ambulance_actions',
|
||||
{
|
||||
title = 'Ambulance',
|
||||
title = _U('ambulance'),
|
||||
elements = elements
|
||||
},
|
||||
function(data, menu)
|
||||
@@ -149,14 +149,14 @@ function OpenAmbulanceActionsMenu()
|
||||
ESX.UI.Menu.Open(
|
||||
'dialog', GetCurrentResourceName(), 'withdraw_society_money_amount',
|
||||
{
|
||||
title = 'Montant du retrait'
|
||||
title = _U('money_withdraw')
|
||||
},
|
||||
function(data, menu)
|
||||
|
||||
local amount = tonumber(data.value)
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification('Montant invalide')
|
||||
ESX.ShowNotification(_U('invalid_amount'))
|
||||
else
|
||||
menu.close()
|
||||
TriggerServerEvent('esx_society:withdrawMoney', 'ambulance', amount)
|
||||
@@ -175,14 +175,14 @@ function OpenAmbulanceActionsMenu()
|
||||
ESX.UI.Menu.Open(
|
||||
'dialog', GetCurrentResourceName(), 'deposit_money_amount',
|
||||
{
|
||||
title = 'Montant du dépôt'
|
||||
title = _U('deposit_amount')
|
||||
},
|
||||
function(data, menu)
|
||||
|
||||
local amount = tonumber(data.value)
|
||||
|
||||
if amount == nil then
|
||||
ESX.ShowNotification('Montant invalide')
|
||||
ESX.ShowNotification(_U('invalid_amount'))
|
||||
else
|
||||
menu.close()
|
||||
TriggerServerEvent('esx_society:depositMoney', 'ambulance', amount)
|
||||
@@ -202,7 +202,7 @@ function OpenAmbulanceActionsMenu()
|
||||
menu.close()
|
||||
|
||||
CurrentAction = 'ambulance_actions_menu'
|
||||
CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour ouvrir le menu'
|
||||
CurrentActionMsg = _U('open_menu')
|
||||
CurrentActionData = {}
|
||||
|
||||
end
|
||||
@@ -217,9 +217,9 @@ function OpenMobileAmbulanceActionsMenu()
|
||||
ESX.UI.Menu.Open(
|
||||
'default', GetCurrentResourceName(), 'mobile_ambulance_actions',
|
||||
{
|
||||
title = 'Ambulance',
|
||||
title = _U('ambulance'),
|
||||
elements = {
|
||||
{label = 'Interaction citoyen', value = 'citizen_interaction'},
|
||||
{label = _U('ems_menu'), value = 'citizen_interaction'},
|
||||
}
|
||||
},
|
||||
function(data, menu)
|
||||
@@ -229,10 +229,10 @@ function OpenMobileAmbulanceActionsMenu()
|
||||
ESX.UI.Menu.Open(
|
||||
'default', GetCurrentResourceName(), 'citizen_interaction',
|
||||
{
|
||||
title = 'Ambulance - Interactions Citoyen',
|
||||
title = _U('ems_menu_title'),
|
||||
elements = {
|
||||
{label = 'Réanimer', value = 'revive'},
|
||||
{label = 'Mettre dans véhicule', value = 'put_in_vehicle'},
|
||||
{label = _U('ems_menu_revive'), value = 'revive'},
|
||||
{label = _U('ems_menu_putincar'), value = 'put_in_vehicle'},
|
||||
}
|
||||
},
|
||||
function(data, menu)
|
||||
@@ -244,7 +244,7 @@ function OpenMobileAmbulanceActionsMenu()
|
||||
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
|
||||
|
||||
if closestPlayer == -1 or closestDistance > 3.0 then
|
||||
ESX.ShowNotification('Aucun joueur à proximité')
|
||||
ESX.ShowNotification(_U('no_players'))
|
||||
else
|
||||
|
||||
local ped = GetPlayerPed(closestPlayer)
|
||||
@@ -257,7 +257,7 @@ function OpenMobileAmbulanceActionsMenu()
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
|
||||
ESX.ShowNotification('Réanimation en cours')
|
||||
ESX.ShowNotification(_U('revive_inprogress'))
|
||||
|
||||
TaskStartScenarioInPlace(playerPed, 'CODE_HUMAN_MEDIC_TEND_TO_DEAD', 0, true)
|
||||
Citizen.Wait(10000)
|
||||
@@ -265,15 +265,15 @@ function OpenMobileAmbulanceActionsMenu()
|
||||
|
||||
if GetEntityHealth(closestPlayerPed) == 0 then
|
||||
TriggerServerEvent('esx_ambulancejob:revive', GetPlayerServerId(closestPlayer))
|
||||
ESX.ShowNotification('Vous avez réanimé ' .. GetPlayerName(closestPlayer))
|
||||
ESX.ShowNotification(_U('revive_complete') .. GetPlayerName(closestPlayer))
|
||||
else
|
||||
ESX.ShowNotification(GetPlayerName(closestPlayer) .. ' a succombé')
|
||||
ESX.ShowNotification(GetPlayerName(closestPlayer) .. _U('isdead'))
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
else
|
||||
ESX.ShowNotification(GetPlayerName(closestPlayer) .. ' n\'est pas inconscient')
|
||||
ESX.ShowNotification(GetPlayerName(closestPlayer) .. _U('unconscious'))
|
||||
end
|
||||
|
||||
end
|
||||
@@ -306,11 +306,11 @@ function OpenCloakroomMenu()
|
||||
ESX.UI.Menu.Open(
|
||||
'default', GetCurrentResourceName(), 'cloakroom',
|
||||
{
|
||||
title = 'Vestiaire',
|
||||
title = _U('cloakroom'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = 'Tenue Civil', value = 'citizen_wear'},
|
||||
{label = 'Tenue Ambulancier', value = 'ambulance_wear'},
|
||||
{label = _U('ems_clothes_civil'), value = 'citizen_wear'},
|
||||
{label = _U('ems_clothes_ems'), value = 'ambulance_wear'},
|
||||
},
|
||||
},
|
||||
function(data, menu)
|
||||
@@ -340,7 +340,7 @@ function OpenCloakroomMenu()
|
||||
end
|
||||
|
||||
CurrentAction = 'ambulance_actions_menu'
|
||||
CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour ouvrir le menu'
|
||||
CurrentActionMsg = _U('open_menu')
|
||||
CurrentActionData = {}
|
||||
|
||||
end,
|
||||
@@ -356,11 +356,11 @@ function OpenVehicleSpawnerMenu()
|
||||
ESX.UI.Menu.Open(
|
||||
'default', GetCurrentResourceName(), 'cloakroom',
|
||||
{
|
||||
title = 'Véhicule',
|
||||
title = _U('veh_menu'),
|
||||
align = 'top-left',
|
||||
elements = {
|
||||
{label = 'Ambulance', value = 'ambulance'},
|
||||
{label = 'Hélicoptère', value = 'polmav'},
|
||||
{label = _U('ambulance'), value = 'ambulance'},
|
||||
{label = _U('helicopter'), value = 'polmav'},
|
||||
},
|
||||
},
|
||||
function(data, menu)
|
||||
@@ -388,7 +388,7 @@ function OpenVehicleSpawnerMenu()
|
||||
menu.close()
|
||||
|
||||
CurrentAction = 'vehicle_spawner_menu'
|
||||
CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour sortir un véhicule'
|
||||
CurrentActionMsg = _U('veh_spawn')
|
||||
CurrentActionData = {}
|
||||
|
||||
end
|
||||
@@ -533,13 +533,13 @@ AddEventHandler('esx_ambulancejob:hasEnteredMarker', function(zone)
|
||||
|
||||
if zone == 'AmbulanceActions' and PlayerData.job ~= nil and PlayerData.job.name == 'ambulance' then
|
||||
CurrentAction = 'ambulance_actions_menu'
|
||||
CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour ouvrir le menu'
|
||||
CurrentActionMsg = _U('open_menu')
|
||||
CurrentActionData = {}
|
||||
end
|
||||
|
||||
if zone == 'VehicleSpawner' and PlayerData.job ~= nil and PlayerData.job.name == 'ambulance' then
|
||||
CurrentAction = 'vehicle_spawner_menu'
|
||||
CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour sortir un véhicule'
|
||||
CurrentActionMsg = _U('veh_spawn')
|
||||
CurrentActionData = {}
|
||||
end
|
||||
|
||||
@@ -559,7 +559,7 @@ AddEventHandler('esx_ambulancejob:hasEnteredMarker', function(zone)
|
||||
if distance ~= -1 and distance <= 1.0 then
|
||||
|
||||
CurrentAction = 'delete_vehicle'
|
||||
CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule'
|
||||
CurrentActionMsg = _U('store_veh')
|
||||
CurrentActionData = {vehicle = vehicle}
|
||||
|
||||
end
|
||||
@@ -585,7 +585,7 @@ Citizen.CreateThread(function()
|
||||
SetBlipAsShortRange(blip, true)
|
||||
|
||||
BeginTextCommandSetBlipName("STRING")
|
||||
AddTextComponentString("Hôpital")
|
||||
AddTextComponentString(_U('hospital'))
|
||||
EndTextCommandSetBlipName(blip)
|
||||
|
||||
end)
|
||||
|
||||
@@ -7,6 +7,7 @@ Config.RemoveWeaponsAfterRPDeath = true
|
||||
Config.RemoveCashAfterRPDeath = true
|
||||
Config.RemoveItemsAfterRPDeath = true
|
||||
Config.EnablePlayerManagement = false
|
||||
Config.Locale = 'fr'
|
||||
|
||||
Config.Zones = {
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
Locales['en'] = {
|
||||
--Cloakroom
|
||||
['cloakroom'] = 'locker Room',
|
||||
['ems_clothes_civil'] = 'civilian Clothes',
|
||||
['ems_clothes_ems'] = 'eMS Clothes',
|
||||
--Vehicles
|
||||
['veh_menu'] = 'vehicle',
|
||||
['veh_spawn'] = 'press ~INPUT_CONTEXT~ to get a Vehicle or Helicopter',
|
||||
['store_veh'] = 'press ~INPUT_CONTEXT~ to store the vehicle',
|
||||
['ambulance'] = 'ambulance',
|
||||
['helicopter'] = 'helicopter',
|
||||
--Action Menu
|
||||
['hospital'] = 'hospital',
|
||||
['revive_inprogress'] = 'revive in progress',
|
||||
['revive_complete'] = 'you have been revived ',
|
||||
['no_players'] = 'no players nearby',
|
||||
['no_vehicles'] = 'no vehicles nearby',
|
||||
['isdead'] = 'is dead',
|
||||
['unconscious'] = 'is not unconscious',
|
||||
--Boss Menu
|
||||
['deposit_society'] = 'eMS Deposit',
|
||||
['withdraw_society'] = 'eMS Withdraw',
|
||||
--Misc
|
||||
['invalid_amount'] = '~r~invalid amount',
|
||||
['open_menu'] = 'press ~INPUT_CONTEXT~ to open the menu',
|
||||
['deposit_amount'] = 'deposit Amount',
|
||||
['money_withdraw'] = 'amount withdrawn',
|
||||
-- F6 Menu
|
||||
['ems_menu'] = 'eMS Menu',
|
||||
['ems_menu_title'] = 'ambulance - EMS Menu',
|
||||
['ems_menu_revive'] = 'revive Player',
|
||||
['ems_menu_putincar'] = 'put in Vehicle',
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
Locales['fr'] = {
|
||||
--Cloakroom
|
||||
['cloakroom'] = 'Vestiaire',
|
||||
['ems_clothes_civil'] = 'Tenue Civil',
|
||||
['ems_clothes_ems'] = 'Tenue Ambulancier',
|
||||
--Vehicles
|
||||
['veh_menu'] = 'véhicule',
|
||||
['veh_spawn'] = 'appuyez sur ~INPUT_CONTEXT~ pour sortir un véhicule',
|
||||
['store_veh'] = 'appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule',
|
||||
['ambulance'] = 'ambulance',
|
||||
['helicopter'] = 'hélicoptère',
|
||||
--Action Menu
|
||||
['hospital'] = 'hôpital',
|
||||
['revive_inprogress'] = 'réanimation en cours',
|
||||
['revive_complete'] = 'vous avez réanimé ',
|
||||
['no_players'] = 'aucun joueur à proximité',
|
||||
['no_vehicles'] = 'aucun véhicule à proximité',
|
||||
['isdead'] = 'a succombé',
|
||||
['unconscious'] = 'n\'est pas inconscient',
|
||||
--Boss Menu
|
||||
['deposit_society'] = 'déposer argent',
|
||||
['withdraw_society'] = 'retirer argent société',
|
||||
--Misc
|
||||
['invalid_amount'] = '~r~montant invalide',
|
||||
['open_menu'] = 'appuyez sur ~INPUT_CONTEXT~ pour ouvrir le menu',
|
||||
['deposit_amount'] = 'montant du dépôt',
|
||||
['money_withdraw'] = 'montant du retrait',
|
||||
-- F6 Menu
|
||||
['ems_menu'] = 'interaction citoyen',
|
||||
['ems_menu_title'] = 'ambulance - Interactions Citoyen',
|
||||
['ems_menu_revive'] = 'réanimer',
|
||||
['ems_menu_putincar'] = 'mettre dans véhicule',
|
||||
}
|
||||
Reference in New Issue
Block a user