Translate armor items

This commit is contained in:
Wuzzy 2019-08-28 20:59:56 +02:00
parent 5388395706
commit 7adccb318a
3 changed files with 38 additions and 14 deletions

View File

@ -11,11 +11,11 @@ armor = {}
armor.materials = { armor.materials = {
-- material craftitem description % -- material craftitem description %
{"wood", "group:planks", "Wooden", 10}, {"wood", "group:planks", { S("Wooden Helmet"), S("Wooden Chestplate"), S("Wooden Boots") }, 10},
{"steel", "default:ingot_steel", "Steel", 20}, {"steel", "default:ingot_steel", { S("Steel Helmet"), S("Steel Chestplate"), S("Steel Boots") }, 20},
{"chainmail", "armor:chainmail_sheet", "Chainmail", 30}, {"chainmail", "armor:chainmail_sheet", { S("Chainmail Helmet"), S("Chainmail Chestplate"), S("Chainmail Boots") }, 30},
{"carbon_steel", "default:ingot_carbon_steel", "Carbon Steel", 40}, {"carbon_steel", "default:ingot_carbon_steel", { S("Carbon Steel Helmet"), S("Carbon Steel Chestplate"), S("Carbon Steel Boots") }, 40},
{"bronze", "default:ingot_bronze", "Bronze", 60}, {"bronze", "default:ingot_bronze", { S("Bronze Helmet"), S("Bronze Chestplate"), S("Bronze Boots") }, 60},
} }
-- Usable slots -- Usable slots
@ -214,18 +214,12 @@ for mat_index, matdef in ipairs(armor.materials) do
local armor_def = math.floor(matdef[4] / #armor.slots) local armor_def = math.floor(matdef[4] / #armor.slots)
for _, slot in ipairs(armor.slots) do for s, slot in ipairs(armor.slots) do
local prettystring = slot:gsub(
"(%a)([%w_']*)",
function(first, rest)
return first:upper()..rest:lower()
end)
minetest.register_craftitem( minetest.register_craftitem(
"armor:" .. slot .. "_" .. mat, "armor:" .. slot .. "_" .. mat,
{ {
description = matdef[3] .. " " .. prettystring, description = matdef[3][s],
inventory_image = "armor_" .. slot .. "_" .. mat .. "_inventory.png", inventory_image = "armor_" .. slot .. "_" .. mat .. "_inventory.png",
wield_image = "armor_" .. slot .. "_" .. mat .. "_inventory.png", wield_image = "armor_" .. slot .. "_" .. mat .. "_inventory.png",

View File

@ -1,9 +1,24 @@
# textdomain: armor # textdomain: armor
Helmet=Helm Helmet=Helm
Chestplate=Brustplatte Chestplate=Brustplatte
Boots=Schuhwerk Boots=Stiefel
Chainmail Sheet=Kettenpanzerplane Chainmail Sheet=Kettenpanzerplane
Armored=Gepanzert Armored=Gepanzert
Craft a piece of armor=Fertigen Sie einen Rüstungsgegenstand Craft a piece of armor=Fertigen Sie einen Rüstungsgegenstand
Warrior=Krieger Warrior=Krieger
Craft 10 pieces of armor=Fertigen Sie 10 Rüstungsgegenstände 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

View File

@ -7,3 +7,18 @@ Armored=
Craft a piece of armor= Craft a piece of armor=
Warrior= Warrior=
Craft 10 pieces of armor= 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=