Merge branch 'main' into patch-1

This commit is contained in:
Stan
2022-09-23 17:29:35 +01:00
committed by GitHub
37 changed files with 651 additions and 153 deletions
+2 -1
View File
@@ -380,7 +380,8 @@ QBShared.Items = {
['dendrogyra_coral'] = {['name'] = 'dendrogyra_coral', ['label'] = 'Dendrogyra', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'dendrogyra_coral.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Its also known as pillar coral'},
['antipatharia_coral'] = {['name'] = 'antipatharia_coral', ['label'] = 'Antipatharia', ['weight'] = 1000, ['type'] = 'item', ['image'] = 'antipatharia_coral.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Its also known as black corals or thorn corals'},
['diving_gear'] = {['name'] = 'diving_gear', ['label'] = 'Diving Gear', ['weight'] = 30000, ['type'] = 'item', ['image'] = 'diving_gear.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'An oxygen tank and a rebreather'},
['diving_fill'] = {['name'] = 'diving_fill', ['label'] = 'Diving Tube', ['weight'] = 3000, ['type'] = 'item', ['image'] = 'diving_tube.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['discription'] = 'An oxygen tube and a rebreather'},
-- Other Tools
['casinochips'] = {['name'] = 'casinochips', ['label'] = 'Casino Chips', ['weight'] = 0, ['type'] = 'item', ['image'] = 'casinochips.png', ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Chips For Casino Gambling'},
['stickynote'] = {['name'] = 'stickynote', ['label'] = 'Sticky note', ['weight'] = 0, ['type'] = 'item', ['image'] = 'stickynote.png', ['unique'] = true, ['useable'] = false, ['shouldClose'] = false, ['combinable'] = nil, ['description'] = 'Sometimes handy to remember something :)'},
+10 -1
View File
@@ -32,7 +32,13 @@ end
--- @return Locale
function Locale:new(opts)
setmetatable(self, Locale)
self.warnOnMissing = opts.warnOnMissing or true
self.fallback = opts.fallbackLang and Locale.new({}, {
warnOnMissing = false,
phrases = opts.fallbackLang.phrases,
}) or false
self.warnOnMissing = type(opts.warnOnMissing) ~= 'boolean' and true or opts.warnOnMissing
self.phrases = {}
self:extend(opts.phrases or {})
@@ -98,6 +104,9 @@ function Locale:t(key, subs)
if self.warnOnMissing then
print(('^3Warning: Missing phrase for key: "%s"'):format(key))
end
if self.fallback then
return self.fallback:t(key, subs)
end
result = key
end