Redo translation of enchanted tools

This commit is contained in:
Wuzzy 2024-12-01 20:06:04 +01:00
parent 2b91f0d013
commit a62ef6c183
3 changed files with 12 additions and 9 deletions

View File

@ -110,8 +110,8 @@ Your tool lasts longer=
Your tool digs faster= Your tool digs faster=
Enchantment Table= Enchantment Table=
Enchant your tools with mese crystals= Enchant your tools with mese crystals=
Enchanted @1 @2@n@3= Enchanted @1@n@2=
Enchanted @1 @2= Enchanted @1=
Steel= Steel=
Bronze= Bronze=
Mese= Mese=

View File

@ -110,8 +110,8 @@ Your tool lasts longer=Ihr Werkzeug hält länger
Your tool digs faster=Ihr Werkzeug arbeitet schneller Your tool digs faster=Ihr Werkzeug arbeitet schneller
Enchantment Table=Zaubertisch Enchantment Table=Zaubertisch
Enchant your tools with mese crystals=Werkzeuge mit Mesekristallen verzaubern Enchant your tools with mese crystals=Werkzeuge mit Mesekristallen verzaubern
Enchanted @1 @2@n@3=@1@2 (verzaubert)@n@3 Enchanted @1@n@2=@1 (verzaubert)@n@2
Enchanted @1 @2=@1@2 (verzaubert) Enchanted @1=@1 (verzaubert)
Steel=Eisen Steel=Eisen
Bronze=Bronze Bronze=Bronze
Mese=Mese Mese=Mese

View File

@ -293,6 +293,8 @@ function enchanting:register_tool(original_tool_name, def)
local original_damage_groups = original_toolcaps.damage_groups local original_damage_groups = original_toolcaps.damage_groups
local original_groupcaps = original_toolcaps.groupcaps local original_groupcaps = original_toolcaps.groupcaps
local original_basename = original_tool_name:match(".*:(.*)") local original_basename = original_tool_name:match(".*:(.*)")
local toolitem = ItemStack(original_tool_name)
local original_desc = toolitem:get_short_description() or original_tool_name
for _, enchant in ipairs(def.enchants) do for _, enchant in ipairs(def.enchants) do
local groupcaps = table.copy(original_groupcaps) local groupcaps = table.copy(original_groupcaps)
local fleshy = original_damage_groups.fleshy local fleshy = original_damage_groups.fleshy
@ -314,9 +316,8 @@ function enchanting:register_tool(original_tool_name, def)
return return
end end
local arg1 = def.material_desc local arg1 = original_desc
local arg2 = def.desc local arg2 = self:get_tooltip(enchant, original_groupcaps[dig_group], fleshy)
local arg3 = self:get_tooltip(enchant, original_groupcaps[dig_group], fleshy)
local enchantedTool = original_tool.mod_origin .. ":enchanted_" .. original_basename .. "_" .. enchant local enchantedTool = original_tool.mod_origin .. ":enchanted_" .. original_basename .. "_" .. enchant
local invimg = original_tool.inventory_image local invimg = original_tool.inventory_image
@ -330,8 +331,10 @@ function enchanting:register_tool(original_tool_name, def)
wieldimg = invimg wieldimg = invimg
end end
minetest.register_tool(":" .. enchantedTool, { minetest.register_tool(":" .. enchantedTool, {
description = S("Enchanted @1 @2\n@3", arg1, arg2, arg3), --~ Enchanted tool description, e.g. "Enchanted Diamond Sword". @1 is the original tool name, @2 is the enchantment text, e.g. "Durability (+20%)"
short_description = S("Enchanted @1 @2", arg1, arg2), description = S("Enchanted @1\n@2", arg1, arg2),
--~ Enchanted tool description, e.g. "Enchanted Diamond Sword"
short_description = S("Enchanted @1", arg1),
inventory_image = invimg, inventory_image = invimg,
wield_image = wieldimg, wield_image = wieldimg,
groups = {not_in_creative_inventory = 1}, groups = {not_in_creative_inventory = 1},