examples/inventory: translate inventory

This commit is contained in:
Kazhnuz 2019-04-14 17:52:30 +02:00
parent 374ca29d3a
commit a224021726

View file

@ -38,10 +38,10 @@ function Inventory:new()
HListBox(self.menusystem, "main", 42, 32, 424-84, 32, 5)
self:addSubMenu("weapon", "Weapons")
self:addSubMenu("shield", "Shields")
self:addSubMenu("stuff", "Stuff")
ExitWidget(self, "main", "Exit")
self:addSubMenu("weapon", "weapons")
self:addSubMenu("shield", "shields")
self:addSubMenu("stuff", "stuff")
ExitWidget(self, "main", "exit")
self:addItem("weapon", 3)
self:addItem("weapon", 2)
@ -89,7 +89,8 @@ function InventoryWidget:new(scene, menu, newmenu, fullname)
local widgetmenu = self.scene.menusystem.menus[menu]
local font = self.scene.assets.fonts["medium"]
self.newmenu = newmenu
InventoryWidget.super.new(self, widgetmenu, font, fullname)
local label = core.lang:translate("inventory", fullname)
InventoryWidget.super.new(self, widgetmenu, font, label)
end
function InventoryWidget:action(source)
@ -114,11 +115,12 @@ end
-- Exit widget
function ExitWidget:new(scene, menu, fullname)
function ExitWidget:new(scene, menu)
self.scene = scene
local widgetmenu = self.scene.menusystem.menus[menu]
local font = self.scene.assets.fonts["medium"]
ExitWidget.super.new(self, widgetmenu, font, fullname)
local label = core.lang:translate("commons", "exit")
ExitWidget.super.new(self, widgetmenu, font, label)
end
function ExitWidget:action(source)