From 7adccb318ae1121f2498a14ac8b5b55f11d0fe6e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Wed, 28 Aug 2019 20:59:56 +0200 Subject: [PATCH] Translate armor items --- mods/armor/init.lua | 20 +++++++------------- mods/armor/locale/armor.de.tr | 17 ++++++++++++++++- mods/armor/locale/template.txt | 15 +++++++++++++++ 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/mods/armor/init.lua b/mods/armor/init.lua index 75aff40..64c644b 100644 --- a/mods/armor/init.lua +++ b/mods/armor/init.lua @@ -11,11 +11,11 @@ armor = {} armor.materials = { -- material craftitem description % - {"wood", "group:planks", "Wooden", 10}, - {"steel", "default:ingot_steel", "Steel", 20}, - {"chainmail", "armor:chainmail_sheet", "Chainmail", 30}, - {"carbon_steel", "default:ingot_carbon_steel", "Carbon Steel", 40}, - {"bronze", "default:ingot_bronze", "Bronze", 60}, + {"wood", "group:planks", { S("Wooden Helmet"), S("Wooden Chestplate"), S("Wooden Boots") }, 10}, + {"steel", "default:ingot_steel", { S("Steel Helmet"), S("Steel Chestplate"), S("Steel Boots") }, 20}, + {"chainmail", "armor:chainmail_sheet", { S("Chainmail Helmet"), S("Chainmail Chestplate"), S("Chainmail Boots") }, 30}, + {"carbon_steel", "default:ingot_carbon_steel", { S("Carbon Steel Helmet"), S("Carbon Steel Chestplate"), S("Carbon Steel Boots") }, 40}, + {"bronze", "default:ingot_bronze", { S("Bronze Helmet"), S("Bronze Chestplate"), S("Bronze Boots") }, 60}, } -- Usable slots @@ -214,18 +214,12 @@ for mat_index, matdef in ipairs(armor.materials) do local armor_def = math.floor(matdef[4] / #armor.slots) - for _, slot in ipairs(armor.slots) do - local prettystring = slot:gsub( - "(%a)([%w_']*)", - function(first, rest) - return first:upper()..rest:lower() - end) - + for s, slot in ipairs(armor.slots) do minetest.register_craftitem( "armor:" .. slot .. "_" .. mat, { - description = matdef[3] .. " " .. prettystring, + description = matdef[3][s], inventory_image = "armor_" .. slot .. "_" .. mat .. "_inventory.png", wield_image = "armor_" .. slot .. "_" .. mat .. "_inventory.png", diff --git a/mods/armor/locale/armor.de.tr b/mods/armor/locale/armor.de.tr index 362481f..da6d026 100644 --- a/mods/armor/locale/armor.de.tr +++ b/mods/armor/locale/armor.de.tr @@ -1,9 +1,24 @@ # textdomain: armor Helmet=Helm Chestplate=Brustplatte -Boots=Schuhwerk +Boots=Stiefel Chainmail Sheet=Kettenpanzerplane Armored=Gepanzert Craft a piece of armor=Fertigen Sie einen Rüstungsgegenstand Warrior=Krieger Craft 10 pieces of armor=Fertigen Sie 10 Rüstungsgegenstände +Wooden Helmet=Holzhelm +Wooden Chestplate=Holzbrustplatte +Wooden Boots=Holzstiefel +Steel Helmet=Stahlhelm +Steel Chestplate=Stahlbrustplatte +Steel Boots=Stahlstiefel +Chainmail Helmet=Kettenpanzerhelm +Chainmail Chestplate=Kettenpanzerbrustplatte +Chainmail Boots=Kettenpanzerstiefel +Carbon Steel Helmet=Karbonstahlhelm +Carbon Steel Chestplate=Karbonstahlbrustplatte +Carbon Steel Boots=Karbonstahlstiefel +Bronze Helmet=Bronzehelm +Bronze Chestplate=Bronzebrustplatte +Bronze Boots=Bronzestiefel diff --git a/mods/armor/locale/template.txt b/mods/armor/locale/template.txt index a81e3a6..a24b255 100644 --- a/mods/armor/locale/template.txt +++ b/mods/armor/locale/template.txt @@ -7,3 +7,18 @@ Armored= Craft a piece of armor= Warrior= Craft 10 pieces of armor= +Wooden Helmet= +Wooden Chestplate= +Wooden Boots= +Steel Helmet= +Steel Chestplate= +Steel Boots= +Chainmail Helmet= +Chainmail Chestplate= +Chainmail Boots= +Carbon Steel Helmet= +Carbon Steel Chestplate= +Carbon Steel Boots= +Bronze Helmet= +Bronze Chestplate= +Bronze Boots=