From a224021726cb844dea7af747c90e64bb469f60dc Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 14 Apr 2019 17:52:30 +0200 Subject: [PATCH] examples/inventory: translate inventory --- examples/menus/inventory/init.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/menus/inventory/init.lua b/examples/menus/inventory/init.lua index 3285c92..d3fa0f3 100644 --- a/examples/menus/inventory/init.lua +++ b/examples/menus/inventory/init.lua @@ -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)