Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch qb locale to ox_lib locale #36

Merged
merged 18 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local function takeCoral(coralIndex)
local times = math.random(2, 5)
if lib.progressBar({
duration = times * 1000,
label = Lang:t('info.collecting_coral'),
label = locale('info.collecting_coral'),
canCancel = true,
useWhileDead = false,
allowSwimming = true,
Expand Down Expand Up @@ -72,7 +72,7 @@ local function createAreaBlips(areaIndex)
SetBlipColour(labelBlip, 0)
SetBlipAsShortRange(labelBlip, true)
BeginTextCommandSetBlipName('STRING')
AddTextComponentSubstringPlayerName(Lang:t('info.diving_area'))
AddTextComponentSubstringPlayerName(locale('info.diving_area'))
EndTextCommandSetBlipName(labelBlip)

return {radiusBlip, labelBlip}
Expand All @@ -87,7 +87,7 @@ local function createCoralZone(coralIndex, coral)
debug = config.debugPoly,
options = {
{
label = Lang:t('info.collect_coral'),
label = locale('info.collect_coral'),
icon = 'fa-solid fa-water',
onSelect = function()
takeCoral(coralIndex)
Expand All @@ -102,7 +102,7 @@ local function createCoralZone(coralIndex, coral)
size = coral.boxDimensions.xyz,
debug = config.debugPoly,
onEnter = function()
lib.showTextUI(Lang:t('info.collect_coral_dt'))
lib.showTextUI(locale('info.collect_coral_dt'))
end,
onExit = function()
lib.hideTextUI()
Expand Down Expand Up @@ -136,7 +136,7 @@ end
local function sellCoral()
if lib.progressBar({
duration = math.random(2000, 4000),
label = Lang:t('info.checking_pockets'),
label = locale('info.checking_pockets'),
useWhileDead = false,
canCancel = true,
anim = {
Expand All @@ -145,7 +145,7 @@ local function sellCoral()
}) then
TriggerServerEvent('qbx_diving:server:sellCoral')
else
exports.qbx_core:Notify(Lang:t('error.canceled'), 'error')
exports.qbx_core:Notify(locale('error.canceled'), 'error')
end
ClearPedTasksImmediately(cache.ped)
end
Expand All @@ -162,7 +162,7 @@ local function createSeller()
if config.useTarget then
exports.ox_target:addLocalEntity(ped, {
{
label = Lang:t('info.sell_coral'),
label = locale('info.sell_coral'),
icon = 'fa-solid fa-dollar-sign',
onSelect = sellCoral,
}
Expand All @@ -174,7 +174,7 @@ local function createSeller()
size = current.zoneDimensions,
debug = config.debugPoly,
onEnter = function()
lib.showTextUI(Lang:t('info.sell_coral_dt'))
lib.showTextUI(locale('info.sell_coral_dt'))
end,
onExit = function()
lib.hideTextUI()
Expand Down
6 changes: 3 additions & 3 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ description 'qbx_diving'
repository 'https://github.com/Qbox-project/qbx_diving'
version '1.1.1'

ox_lib 'locale'

shared_script {
'@ox_lib/init.lua',
'@qbx_core/shared/locale.lua',
'locales/en.lua',
'locales/*.lua',
}

server_scripts {
Expand All @@ -23,6 +22,7 @@ client_scripts {
files {
'config/client.lua',
'config/shared.lua',
'locales/*.json'
}

lua54 'yes'
Expand Down
15 changes: 15 additions & 0 deletions locales/ar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"error": {
"canceled": "تم الالغاء",
"no_coral": "ليس لديك أي مرجان للبيع"
},
"info": {
"collecting_coral": "جمع المرجان",
"diving_area": "ﺹﻮﻐﻟﺍ ﺔﻘﻄﻨﻣ",
"collect_coral": "جمع المرجان",
"collect_coral_dt": "[E] - جمع المرجان",
"checking_pockets": "فحص الحقيبة لبيع المرجان",
"sell_coral": "بيع المرجان",
"sell_coral_dt": "[E] - بيع المرجان"
}
}
40 changes: 0 additions & 40 deletions locales/ar.lua

This file was deleted.

15 changes: 15 additions & 0 deletions locales/cs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"error": {
"canceled": "Zrušeno",
"no_coral": "Nemáte žádný korál k prodeji..."
},
"info": {
"collecting_coral": "Sbírání korálu",
"diving_area": "Plocha potápění",
"collect_coral": "Sbírejte korál",
"collect_coral_dt": "[E] - Sbírat korál",
"checking_pockets": "Kontrola inventáře pro prodej korálu...",
"sell_coral": "Prodej korálu",
"sell_coral_dt": "[E] - Prodat korál"
}
}
24 changes: 0 additions & 24 deletions locales/cs.lua

This file was deleted.

15 changes: 15 additions & 0 deletions locales/da.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"error": {
"canceled": "Annulleret",
"no_coral": "Du har ingen koraller du kan sælge..."
},
"info": {
"collecting_coral": "Samler koraller",
"diving_area": "Dykker Område",
"collect_coral": "Saml koraller",
"collect_coral_dt": "[E] - Saml 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"
}
}
40 changes: 0 additions & 40 deletions locales/da.lua

This file was deleted.

15 changes: 15 additions & 0 deletions locales/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"error": {
"canceled": "Abgebrochen",
"no_coral": "Du hast kein Korallen zum Verkaufen..."
},
"info": {
"collecting_coral": "Korallen sammeln",
"diving_area": "Tauchgebiet",
"collect_coral": "Korallen sammeln",
"collect_coral_dt": "[E] - Korallen sammeln",
"checking_pockets": "Inventar auf korallen zum verkaufen überprüfen...",
"sell_coral": "Korallen verkaufen",
"sell_coral_dt": "[E] - Korallen verkaufen"
}
}
23 changes: 0 additions & 23 deletions locales/de.lua

This file was deleted.

15 changes: 15 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"error": {
"canceled": "Canceled",
"no_coral": "You don't have any coral to sell..."
},
"info": {
"collecting_coral": "Collecting coral",
"diving_area": "Diving Area",
"collect_coral": "Collect coral",
"collect_coral_dt": "[E] - Collect coral",
"checking_pockets": "Checking inventory for coral to sell...",
"sell_coral": "Sell coral",
"sell_coral_dt": "[E] - Sell coral"
}
}
20 changes: 0 additions & 20 deletions locales/en.lua

This file was deleted.

15 changes: 15 additions & 0 deletions locales/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"error": {
"canceled": "Cancelado",
"no_coral": "No tienes ningún coral para vender..."
},
"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"
}
}
40 changes: 0 additions & 40 deletions locales/es.lua

This file was deleted.

Loading