Skip to content

Commit

Permalink
refactor(crafting): labels and locales (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skryptific authored and thelindat committed Jan 24, 2023
1 parent bbfb271 commit 3fb4183
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function client.openInventory(inv, data)
right = {
type = 'crafting',
id = data.id,
label = data.label or locale('crafting_bench'),
label = right.label or locale('crafting_bench'),
index = data.index,
slots = right.slots,
items = right.items,
Expand Down
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@
"dumpster": "Dumpster",
"crafting_item": "Crafting %s",
"crafting_bench": "Crafting Bench",
"open_crafting_bench": "Open Crafting Bench",
"not_enough_durability": "%s does not have enough durability"
}
8 changes: 6 additions & 2 deletions locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"unable_stack_items": "Je kan deze items niet op elkaar stapelen",
"police_evidence": "Politie bewijskluis",
"open_police_evidence": "Open Politie bewijskluis",
"open_stash": "Open Stash",
"open_stash": "Open Opslag",
"locker_number": "Kluisnummer",
"locker_no_value": "Je moet een waarde invullen om de kluis te openen",
"locker_must_number": "De waarde moet een nummer zijn",
Expand All @@ -81,5 +81,9 @@
"no_durability": "Levensduur van item is verbruikt",
"cannot_give": "Niet in staat om %s %s te geven aan het doel",
"evidence_cannot_take": "Je rang is niet hoog genoeg om van de bewijskluis te pakken",
"dumpster": "Afvalcontainer"
"dumpster": "Afvalcontainer",
"crafting_item": "%s aan het maken",
"crafting_bench": "Werkbank",
"open_crafting_bench": "Open Werkbank",
"not_enough_durability": "%s heeft niet genoeg levensduur."
}
4 changes: 2 additions & 2 deletions modules/crafting/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ local function createCraftingBench(id, data)
zone.index = i
zone.options = {
{
label = 'Open Crafting Bench',
label = zone.label or locale('open_crafting_bench'),
canInteract = data.groups and function()
return client.hasGroup(data.groups)
end or nil,
onSelect = function()
client.openInventory('crafting', { id = id, index = i })
end,
distance = zone.distance or 2.0,
icon = 'fas fa-wrench',
icon = zone.icon or 'fas fa-wrench',
}
}

Expand Down

0 comments on commit 3fb4183

Please sign in to comment.