refactor: update modules and locales

This commit is contained in:
Matthew
2024-03-03 16:36:53 -05:00
committed by GitHub
parent f58de0f3c4
commit b672697a7f
22 changed files with 180 additions and 387 deletions
+13 -9
View File
@@ -20,13 +20,13 @@ end
lib.callback.register('qbx_divegear:client:fillTank', function()
if IsPedSwimmingUnderWater(cache.ped) then
exports.qbx_core:Notify(Lang:t('error.underwater', {oxygenlevel = oxygenLevel}), 'error')
exports.qbx_core:Notify(locale('error.underwater', {oxygenlevel = oxygenLevel}), 'error')
return false
end
if lib.progressBar({
duration = config.refillTankTimeMs,
label = Lang:t('info.filling_air'),
label = locale('info.filling_air'),
useWhileDead = false,
canCancel = true,
anim = {
@@ -36,7 +36,7 @@ lib.callback.register('qbx_divegear:client:fillTank', function()
}
}) then
oxygenLevel = config.startingOxygenLevel
exports.qbx_core:Notify(Lang:t('success.tube_filled'), 'success')
exports.qbx_core:Notify(locale('success.tube_filled'), 'success')
if currentGear.enabled then
enableScuba()
end
@@ -76,7 +76,7 @@ end
local function takeOffSuit()
if lib.progressBar({
duration = config.takeOffSuitTimeMs,
label = Lang:t('info.pullout_suit'),
label = locale('info.pullout_suit'),
useWhileDead = false,
canCancel = true,
anim = {
@@ -89,7 +89,7 @@ local function takeOffSuit()
SetPedMaxTimeUnderwater(cache.ped, 50.00)
currentGear.enabled = false
deleteGear()
exports.qbx_core:Notify(Lang:t('success.took_out'))
exports.qbx_core:Notify(locale('success.took_out'))
-- Stop breathing suit audio
end
end
@@ -98,7 +98,11 @@ local function startOxygenLevelDrawTextThread()
CreateThread(function()
while currentGear.enabled do
if IsPedSwimmingUnderWater(cache.ped) then
DrawText2D(oxygenLevel..'', vec2(1.0, 1.42), 1.0, 1.0, 0.45, 4)
qbx.drawText2d({
text = oxygenLevel..'',
coords = vec2(1.0, 1.42),
scale = 0.45
})
end
Wait(0)
end
@@ -125,18 +129,18 @@ end
local function putOnSuit()
if oxygenLevel <= 0 then
exports.qbx_core:Notify(Lang:t('error.need_otube'), 'error')
exports.qbx_core:Notify(locale('error.need_otube'), 'error')
return
end
if IsPedSwimming(cache.ped) or cache.vehicle then
exports.qbx_core:Notify(Lang:t('error.not_standing_up'), 'error')
exports.qbx_core:Notify(locale('error.not_standing_up'), 'error')
return
end
if lib.progressBar({
duration = config.putOnSuitTimeMs,
label = Lang:t('info.put_suit'),
label = locale('info.put_suit'),
useWhileDead = false,
canCancel = true,
anim = {
+7 -5
View File
@@ -5,19 +5,21 @@ description 'items to help players breathe and move underwater'
repository 'https://github.com/Qbox-project/qbx_divegear'
version '1.0.0'
ox_lib 'locale'
shared_scripts {
'@ox_lib/init.lua',
'@qbx_core/modules/utils.lua',
'@qbx_core/shared/locale.lua',
'locales/en.lua',
'locales/*.lua',
'@qbx_core/modules/lib.lua',
}
server_script 'server/main.lua'
client_script 'client/main.lua'
file 'config/client.lua'
files {
'config/client.lua',
'locales/*.json',
}
lua54 'yes'
use_experimental_fxv2_oal 'yes'
+16
View File
@@ -0,0 +1,16 @@
{
"error": {
"not_standing_up": "/divingsuit لنزع بدلة الغوص الخاصة بك",
"need_otube": "أنت لا ترتدي معدات الغوص",
"underwater": "الوقوف لاستخدام خزان الأكسجين"
},
"success": {
"took_out": "جاري اخد لباس الغوض",
"tube_filled": "You've successfully refilled your air tank!"
},
"info": {
"put_suit": "وضعت بدلة الغوص",
"pullout_suit": "ترك بدلة الغوص",
"filling_air": "Filling air..."
}
}
-27
View File
@@ -1,27 +0,0 @@
local Translations = {
error = {
["canceled"] = "تم الالغاء",
["take_off"] = "/divingsuit لنزع بدلة الغوص الخاصة بك",
["not_wearing"] = "أنت لا ترتدي معدات الغوص",
["not_standing_up"] = "الوقوف لاستخدام خزان الأكسجين",
},
success = {
["took_out"] = "جاري اخد لباس الغوض",
},
info = {
["put_suit"] = "وضعت بدلة الغوص",
["pullout_suit"] = "ترك بدلة الغوص",
},
warning = {
["oxygen_one_minute"] = "لديك أقل من ستين ثانية متبقية",
["oxygen_running_out"] = "الأكسجين ينفد منك",
},
}
if GetConvar('qb_locale', 'en') == 'ar' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
+16
View File
@@ -0,0 +1,16 @@
{
"error": {
"not_standing_up": "Du skal stå op for at tage dykkerudstyret på",
"need_otube": "You need to refill your oxygen! Get a replacement air supply!",
"underwater": "You cannot do this underwater..."
},
"success": {
"took_out": "Du tog din våddragt af",
"tube_filled": "You've successfully refilled your air tank!"
},
"info": {
"put_suit": "Tag en dykkerdragt på",
"pullout_suit": "Træk en dykker dragt ud..",
"filling_air": "Filling air..."
}
}
-40
View File
@@ -1,40 +0,0 @@
local Translations = {
error = {
["canceled"] = "annulleret",
["911_chatmessage"] = "Alarmcentral",
["take_off"] = "/divingsuit for at tage din dykkerdragt af",
["not_wearing"] = "Du har ikke dykkerudstyr på ..",
["no_coral"] = "Du har ingen koraller du kan sælge..",
["not_standing_up"] = "Du skal stå op for at tage dykkerudstyret på",
},
success = {
["took_out"] = "Du tog din våddragt af",
},
info = {
["collecting_coral"] = "Samler koraller",
["diving_area"] = "Dykker område",
["collect_coral"] = "Saml koraller",
["collect_coral_dt"] = "[E] - aml koraller",
["checking_pockets"] = "Du tjkker dine lommer for koraller du kan sælge",
["sell_coral"] = "Sælg koraller",
["sell_coral_dt"] = "[E] - Sælg koraller",
["blip_text"] = "112 - En person samler koraller ulovligt",
["put_suit"] = "Tag en dykkerdragt på",
["pullout_suit"] = "Træk en dykker dragt ud ..",
["cop_msg"] = "Disse koraller er muligvis stjålet",
["cop_title"] = "Ulovlig dykning",
["command_diving"] = "Tag din dykkerdragt af",
},
warning = {
["oxygen_one_minute"] = "Du har mindre end 1 minuts luft tilbage",
["oxygen_running_out"] = " Du er ved at løbe tør for luft",
},
}
if GetConvar('qb_locale', 'en') == 'da' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
+16
View File
@@ -0,0 +1,16 @@
{
"error": {
"not_standing_up": "You need to be on solid ground to put this on...",
"need_otube": "You need to refill your oxygen! Get a replacement air supply!",
"underwater": "You cannot do this underwater..."
},
"success": {
"took_out": "You've taken your gear off!",
"tube_filled": "You've successfully refilled your air tank!"
},
"info": {
"put_suit": "Putting on your diving suit...",
"pullout_suit": "Taking off your diving suit...",
"filling_air": "Filling air..."
}
}
-26
View File
@@ -1,26 +0,0 @@
local Translations = {
error = {
canceled = "Canceled",
not_standing_up = "You need to be on solid ground to put this on...",
need_otube = "You need to refill your oxygen! Get a replacement air supply!",
underwater = "Cannot do this underwater",
},
success = {
took_out = "You took your diving gear off",
tube_filled = "You've successfully refilled your air tank!"
},
info = {
put_suit = "Putting on your diving suit...",
pullout_suit = "Taking off your diving suit...",
filling_air = "Filling air..."
},
warning = {
oxygen_one_minute = "You have less than one minute of air remaining!",
oxygen_running_out = "Your air tank is running out of air!",
},
}
Lang = Lang or Locale:new({
phrases = Translations,
warnOnMissing = true
})
+16
View File
@@ -0,0 +1,16 @@
{
"error": {
"not_standing_up": "Tienes que estar de pie para ponerte el equipo de buceo",
"need_otube": "You need to refill your oxygen! Get a replacement air supply!",
"underwater": "You cannot do this underwater..."
},
"success": {
"took_out": "Te quitaste tu traje de neopreno",
"tube_filled": "You've successfully refilled your air tank!"
},
"info": {
"put_suit": "Ponerse equipo de buceo",
"pullout_suit": "Saca un equipo de buceo..",
"filling_air": "Filling air..."
}
}
-40
View File
@@ -1,40 +0,0 @@
local Translations = {
error = {
["canceled"] = "Cancelado",
["911_chatmessage"] = "MENSAJE 911",
["take_off"] = "/divingsuit para quitarte tu traje de buceo",
["not_wearing"] = "No estás usando equipo de buceo..",
["no_coral"] = "No tienes ningún coral para vender..",
["not_standing_up"] = "Tienes que estar de pie para ponerte el equipo de buceo",
},
success = {
["took_out"] = "Te quitaste tu traje de neopreno",
},
info = {
["collecting_coral"] = "Recolectando coral",
["diving_area"] = "Area de buceo",
["collect_coral"] = "Recolectar coral",
["collect_coral_dt"] = "[E] - Recolectar coral",
["checking_pockets"] = "Revisando bolsillos para vender coral",
["sell_coral"] = "Vender coral",
["sell_coral_dt"] = "[E] - Vender coral",
["blip_text"] = "Sitio de buceo - 911",
["put_suit"] = "Ponerse equipo de buceo",
["pullout_suit"] = "Saca un equipo de buceo..",
["cop_msg"] = "Este coral puede ser robado",
["cop_title"] = "Buceo ilegal",
["command_diving"] = "Quitarse equipo de buceo",
},
warning = {
["oxygen_one_minute"] = "Le queda menos de 1 minuto de aire",
["oxygen_running_out"] = "Su equipo de buceo se está quedando sin aire",
},
}
if GetConvar('qb_locale', 'en') == 'es' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
+16
View File
@@ -0,0 +1,16 @@
{
"error": {
"not_standing_up": "Sukeldumisvarustuse selga panemiseks peate püsti seisma",
"need_otube": "You need to refill your oxygen! Get a replacement air supply!",
"underwater": "You cannot do this underwater..."
},
"success": {
"took_out": "Sa võtsid sukeldumisülikonna seljast",
"tube_filled": "You've successfully refilled your air tank!"
},
"info": {
"put_suit": "Pane selga sukeldumisvarustust",
"pullout_suit": "Võta välja sukeldumisvarustus..",
"filling_air": "Filling air..."
}
}
-40
View File
@@ -1,40 +0,0 @@
local Translations = {
error = {
["canceled"] = "Tühistatud",
["911_chatmessage"] = "911 KIRI",
["take_off"] = "/divingsuit kui soovid võtta seljast sukeldumisvarustust",
["not_wearing"] = "Te ei kanna sukeldumisvarustust ..",
["no_coral"] = "Teil pole koralle, mida müüa..",
["not_standing_up"] = "Sukeldumisvarustuse selga panemiseks peate püsti seisma",
},
success = {
["took_out"] = "Sa võtsid sukeldumisülikonna seljast",
},
info = {
["collecting_coral"] = "Korallide kogumine",
["diving_area"] = "Sukeldumiskoht",
["collect_coral"] = "Koguge koralle",
["collect_coral_dt"] = "[E] - Koguge koralle",
["checking_pockets"] = "Taskute kontrollimine koralli müümiseks",
["sell_coral"] = "Müü koralle",
["sell_coral_dt"] = "[E] - Müü koralle",
["blip_text"] = "911 - Sukeldumiskoht",
["put_suit"] = "Pane selga sukeldumisvarustust",
["pullout_suit"] = "Võta välja sukeldumisvarustus ..",
["cop_msg"] = "Se korall võib olla varastatud",
["cop_title"] = "Ebaseaduslik sukeldumine",
["command_diving"] = "Võta seljast Sukeldumisvarustuse",
},
warning = {
["oxygen_one_minute"] = "Teil on järelejäänud vähem kui 1 minut õhku",
["oxygen_running_out"] = "Õhk hakkab otsa saama",
},
}
if GetConvar('qb_locale', 'en') == 'et' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
+16
View File
@@ -0,0 +1,16 @@
{
"error": {
"not_standing_up": "Dalış teçhizatını takmak için ayağa kalkman gerekiyor",
"need_otube": "You need to refill your oxygen! Get a replacement air supply!",
"underwater": "You cannot do this underwater..."
},
"success": {
"took_out": "Dalgıç giysini çıkardın",
"tube_filled": "You've successfully refilled your air tank!"
},
"info": {
"put_suit": "Dalış kıyafeti giy",
"pullout_suit": "Dalgıç kıyafeti çıkarılıyor..",
"filling_air": "Filling air..."
}
}
-40
View File
@@ -1,40 +0,0 @@
local Translations = {
error = {
canceled = "Annulé",
["911_chatmessage"] = "MESSAGE 911",
no_coral = "Vous n'avez pas de corail à vendre",
not_standing_up = "Vous devez être debout pour vous equiper",
need_otube = "Vous avez besoin d'une bouteille d'oxygène",
oxygenlevel = "Le niveau d'oxygène est %{oxygenlevel}, Il doit être à 0%"
},
success = {
took_out = "Vous avez enlevé votre kit de plongée",
tube_filled = "La Bouteille à été rempli"
},
info = {
collecting_coral = "Vous récupérez des coraux",
diving_area = "Zone de plongée",
collect_coral = "Récupérer des coraux",
collect_coral_dt = "[E] - Récupérer des coraux",
checking_pockets = "Vend des coraux...",
sell_coral = "Vendre des coraux",
sell_coral_dt = "[E] - Vendre des coraux",
blip_text = "911 - Site de plongée",
put_suit = "Mettre votre kit de plongée",
pullout_suit = "Enlever votre kit de plongée",
cop_msg = "Ce corail peut être volé",
cop_title = "Plongée illégale"
},
warning = {
oxygen_one_minute = "Il vous reste une minute d'oxygène",
oxygen_running_out = "Vous n'avez plus d'oxygène",
},
}
if GetConvar('qb_locale', 'en') == 'fr' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
+16
View File
@@ -0,0 +1,16 @@
{
"error": {
"not_standing_up": "Þú þarft að standa upp til að setja á þig köfunarbúnaðinn",
"need_otube": "You need to refill your oxygen! Get a replacement air supply!",
"underwater": "You cannot do this underwater..."
},
"success": {
"took_out": "Þú tókst blautbúninginn þinn af þér",
"tube_filled": "You've successfully refilled your air tank!"
},
"info": {
"put_suit": "Farðu í köfunargalla",
"pullout_suit": "Dragðu fram köfunargalla..",
"filling_air": "Filling air..."
}
}
-40
View File
@@ -1,40 +0,0 @@
local Translations = {
error = {
["canceled"] = "Hætt",
["911_chatmessage"] = "911 SKILABOÐ",
["take_off"] = "/divingsuit til að fara úr köfunarbúningnum",
["not_wearing"] = "Þú ert ekki í köfunarbúnaði ..",
["no_coral"] = "Þú hefur engan kóral til að selja..",
["not_standing_up"] = "Þú þarft að standa upp til að setja á þig köfunarbúnaðinn",
},
success = {
["took_out"] = "Þú tókst blautbúninginn þinn af þér",
},
info = {
["collecting_coral"] = "Söfnun kórals",
["diving_area"] = "Köfunarsvæði",
["collect_coral"] = "Safna kóral",
["collect_coral_dt"] = "[E] - Safna kóral",
["checking_pockets"] = "Athuga vasa til að selja kóral",
["sell_coral"] = "Selja Kóral",
["sell_coral_dt"] = "[E] - Selja Kóral",
["blip_text"] = "911 - Köfunarsíða",
["put_suit"] = "Farðu í köfunargalla",
["pullout_suit"] = "Dragðu fram köfunargalla ..",
["cop_msg"] = "Þessum kóral gæti verið stolið",
["cop_title"] = "Ólögleg köfun",
["command_diving"] = "Farðu úr köfunarbúningnum",
},
warning = {
["oxygen_one_minute"] = "Þú átt innan við 1 mínútu af lofti eftir",
["oxygen_running_out"] = "Köfunarbúnaðurinn þinn er að verða uppiskroppa með loftið",
},
}
if GetConvar('qb_locale', 'en') == 'is' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
+16
View File
@@ -0,0 +1,16 @@
{
"error": {
"not_standing_up": "Devi essere in piedi per indossare l'attrezzatura subacquea",
"need_otube": "You need to refill your oxygen! Get a replacement air supply!",
"underwater": "You cannot do this underwater..."
},
"success": {
"took_out": "Ti sei tolto la muta da sub",
"tube_filled": "You've successfully refilled your air tank!"
},
"info": {
"put_suit": "Indossando muta da sub..",
"pullout_suit": "Rimuovendo muta da sub..",
"filling_air": "Filling air..."
}
}
-40
View File
@@ -1,40 +0,0 @@
local Translations = {
error = {
["canceled"] = "Annullato",
["911_chatmessage"] = "911",
["take_off"] = "/divingsuit per togliersi la muta da sub",
["not_wearing"] = "Non indossi un'attrezzatura da sub..",
["no_coral"] = "Non hai coralli da vendere..",
["not_standing_up"] = "Devi essere in piedi per indossare l'attrezzatura subacquea",
},
success = {
["took_out"] = "Ti sei tolto la muta da sub",
},
info = {
["collecting_coral"] = "Raccogliendo coralli..",
["diving_area"] = "Area di immersione",
["collect_coral"] = "Raccogli coralli",
["collect_coral_dt"] = "[E] - Raccogli coralli",
["checking_pockets"] = "Controllando i coralli..",
["sell_coral"] = "Vendi coralli",
["sell_coral_dt"] = "[E] - Vendi coralli",
["blip_text"] = "911 - Area di immersione",
["put_suit"] = "Indossando muta da sub..",
["pullout_suit"] = "Rimuovendo muta da sub..",
["cop_msg"] = "Dei coralli potrebbero essere stati rubati",
["cop_title"] = "Pesca illegale",
["command_diving"] = "Togliti la muta da sub",
},
warning = {
["oxygen_one_minute"] = "Hai meno di 1 minuto di aria rimanente",
["oxygen_running_out"] = "La tua attrezzatura da sub sta finendo l'aria",
},
}
if GetConvar('qb_locale', 'en') == 'it' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
+16
View File
@@ -0,0 +1,16 @@
{
"error": {
"not_standing_up": "Je moet rechtop staan om de duikuitrusting aan te trekken",
"need_otube": "You need to refill your oxygen! Get a replacement air supply!",
"underwater": "You cannot do this underwater..."
},
"success": {
"took_out": "Je hebt je wetsuit uitgedaan",
"tube_filled": "You've successfully refilled your air tank!"
},
"info": {
"put_suit": "Doe een duikpak aan",
"pullout_suit": "Trek een duikpak uit..",
"filling_air": "Filling air..."
}
}
-40
View File
@@ -1,40 +0,0 @@
local Translations = {
error = {
["canceled"] = "Geannuleerd",
["911_chatmessage"] = "911 BERICHT",
["take_off"] = "/divingsuit om je duikpak uit te doen",
["not_wearing"] = "Je hebt geen duikuitrusting aan..",
["no_coral"] = "Je hebt geen koraal om te verkopen..",
["not_standing_up"] = "Je moet rechtop staan om de duikuitrusting aan te trekken",
},
success = {
["took_out"] = "Je hebt je wetsuit uitgedaan",
},
info = {
["collecting_coral"] = "Koraal verzamelen",
["diving_area"] = "Duikgebied",
["collect_coral"] = "Verzamel koraal",
["collect_coral_dt"] = "[E] - Verzamel Koraal",
["checking_pockets"] = "Zakken controleren om koraal te verkopen",
["sell_coral"] = "Verkoop Koraal",
["sell_coral_dt"] = "[E] - Verkoop Koraal",
["blip_text"] = "911 - Duiklocatie",
["put_suit"] = "Doe een duikpak aan",
["pullout_suit"] = "Trek een duikpak uit ..",
["cop_msg"] = "Dit koraal is mogelijk gestolen",
["cop_title"] = "Illegaal duiken",
["command_diving"] = "Doe je duikpak uit",
},
warning = {
["oxygen_one_minute"] = "Je hebt minder dan 1 minuut lucht over",
["oxygen_running_out"] = "Je duikuitrusting heeft bijna geen lucht meer",
},
}
if GetConvar('qb_locale', 'en') == 'nl' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end
+16
View File
@@ -0,0 +1,16 @@
{
"error": {
"not_standing_up": "Dalış teçhizatını takmak için ayağa kalkman gerekiyor",
"need_otube": "You need to refill your oxygen! Get a replacement air supply!",
"underwater": "You cannot do this underwater..."
},
"success": {
"took_out": "Dalgıç giysini çıkardın",
"tube_filled": "You've successfully refilled your air tank!"
},
"info": {
"put_suit": "Dalış kıyafeti giy",
"pullout_suit": "Dalgıç kıyafeti çıkarılıyor..",
"filling_air": "Filling air..."
}
}
-40
View File
@@ -1,40 +0,0 @@
local Translations = {
error = {
["canceled"] = "İptal edildi",
["911_chatmessage"] = "911 MESAJI",
["take_off"] = "dalış kıyafetini çıkarmak için /divingsuit yaz",
["not_wearing"] = "Dalış teçhizatı takmıyorsun..",
["no_coral"] = "Satacak mercanınız yok..",
["not_standing_up"] = "Dalış teçhizatını takmak için ayağa kalkman gerekiyor",
},
success = {
["took_out"] = "Dalgıç giysini çıkardın",
},
info = {
["collecting_coral"] = "Mercan toplanıyor",
["diving_area"] = "Dalış Alanı",
["collect_coral"] = "Mercan topla",
["collect_coral_dt"] = "[E] - Mercan Topla",
["checking_pockets"] = "Mercan Satmak İçin Ceplerin Kontrol Ediliyor",
["sell_coral"] = "Mercan Sat",
["sell_coral_dt"] = "[E] - Mercan Sat",
["blip_text"] = "911 - Dalış Alanı",
["put_suit"] = "Dalış kıyafeti giy",
["pullout_suit"] = "Dalgıç kıyafeti çıkarılıyor..",
["cop_msg"] = "Çalıntı mercan olabilir",
["cop_title"] = "Yasadışı dalış",
["command_diving"] = "Dalış elbiseni çıkar",
},
warning = {
["oxygen_one_minute"] = "1 dakikadan az havanız kaldı",
["oxygen_running_out"] = "Dalış teçhizatınızın havası bitiyor",
},
}
if GetConvar('qb_locale', 'en') == 'tr' then
Lang = Locale:new({
phrases = Translations,
warnOnMissing = true,
fallbackLang = Lang,
})
end