some fixes #8
4
api.lua
4
api.lua
@ -647,7 +647,7 @@ end
|
||||
-- \returns nil
|
||||
industrialtest.api.registerResourceDust=function(name,displayName,resources,color,registerMaceratorRecipe)
|
||||
minetest.register_craftitem("industrialtest:"..name.."_dust",{
|
||||
description=S(displayName.." Dust"),
|
||||
description=S("@1 Dust", displayName),
|
||||
|
||||
inventory_image="industrialtest_dust.png",
|
||||
color=color
|
||||
})
|
||||
@ -693,7 +693,7 @@ industrialtest.api.registerStorageCell=function(name,displayName,node,modname)
|
||||
modname="industrialtest"
|
||||
end
|
||||
minetest.register_craftitem("industrialtest:"..name.."_cell",{
|
||||
description=S(displayName.." Cell"),
|
||||
description=S("@1 Cell", displayName),
|
||||
inventory_image=modname.."_"..name.."_cell.png",
|
||||
on_place=function(itemstack,user,pointed)
|
||||
if pointed.type~="node" or not user or not user:is_player() then
|
||||
|
@ -47,7 +47,7 @@ end
|
||||
|
||||
local function registerCable(name,displayName,size,flow,registerInsulated)
|
||||
local definition={
|
||||
description=S(displayName.." Cable"),
|
||||
description=S("@1 Cable", displayName),
|
||||
inventory_image="industrialtest_"..name.."_cable_inv.png",
|
||||
tiles={"industrialtest_"..name.."_cable.png"},
|
||||
wield_image="industrialtest_"..name.."_cable_inv.png",
|
||||
@ -142,7 +142,7 @@ local function registerCable(name,displayName,size,flow,registerInsulated)
|
||||
minetest.register_node("industrialtest:"..name.."_cable",definition)
|
||||
if registerInsulated then
|
||||
definition=table.copy(definition)
|
||||
definition.description=S("Insulated "..displayName.." Cable")
|
||||
definition.description=S("Insulated @1 Cable", displayName)
|
||||
definition.inventory_image="industrialtest_insulated_"..name.."_cable_inv.png"
|
||||
definition.tiles={"industrialtest_insulated_"..name.."_cable.png"}
|
||||
definition.wield_image="industrialtest_insulated_"..name.."_cable_inv.png"
|
||||
|
@ -94,15 +94,15 @@ end
|
||||
if industrialtest.mclAvailable then
|
||||
industrialtest.internal.registerMetal=function(name,displayName,oreBlastResistance,oreHardness,rawBlockBlastResistance,rawBlockHardness,blockBlastResistance,blockHardness)
|
||||
minetest.register_craftitem("industrialtest:raw_"..name,{
|
||||
description=S("Raw "..displayName),
|
||||
description=S("Raw @1", displayName),
|
||||
inventory_image="industrialtest_mcl_raw_"..name..".png"
|
||||
})
|
||||
minetest.register_craftitem("industrialtest:"..name.."_ingot",{
|
||||
description=S(displayName.." Ingot"),
|
||||
description=S("@1 Ingot", displayName),
|
||||
inventory_image="industrialtest_mcl_"..name.."_ingot.png"
|
||||
})
|
||||
minetest.register_node("industrialtest:stone_with_"..name,{
|
||||
description=S(displayName.." Ore"),
|
||||
description=S("@1 Ore", displayName),
|
||||
tiles={"default_stone.png^industrialtest_mcl_stone_with_"..name..".png"},
|
||||
sounds=mcl_sounds.node_sound_stone_defaults(),
|
||||
drop="industrialtest:raw_"..name,
|
||||
@ -114,7 +114,7 @@ if industrialtest.mclAvailable then
|
||||
_mcl_fortune_drop = mcl_core.fortune_drop_ore,
|
||||
})
|
||||
minetest.register_node("industrialtest:deepslate_with_"..name,{
|
||||
description=S("Deepslate with "..displayName),
|
||||
description=S("Deepslate with @1", displayName),
|
||||
tiles={"mcl_deepslate_top.png^industrialtest_mcl_stone_with_"..name..".png","mcl_deepslate_top.png^industrialtest_mcl_stone_with_"..name..".png","mcl_deepslate.png^industrialtest_mcl_stone_with_"..name..".png"},
|
||||
sounds=mcl_sounds.node_sound_stone_defaults(),
|
||||
drop="industrialtest:raw_"..name,
|
||||
@ -128,7 +128,7 @@ if industrialtest.mclAvailable then
|
||||
_mcl_fortune_drop = mcl_core.fortune_drop_ore,
|
||||
})
|
||||
minetest.register_node("industrialtest:raw_"..name.."_block",{
|
||||
description=S("Raw "..displayName.." Block"),
|
||||
description=S("Raw @1 Block", displayName),
|
||||
tiles={"industrialtest_mcl_raw_"..name.."_block.png"},
|
||||
groups={pickaxey=2,building_block=1,blast_furnace_smeltable=1},
|
||||
sounds=mcl_sounds.node_sound_metal_defaults(),
|
||||
@ -136,7 +136,7 @@ if industrialtest.mclAvailable then
|
||||
_mcl_hardness=rawBlockHardness,
|
||||
})
|
||||
minetest.register_node("industrialtest:"..name.."_block",{
|
||||
description=S("Block of "..displayName),
|
||||
description=S("Block of @1", displayName),
|
||||
tiles={"industrialtest_"..name.."_block.png"},
|
||||
groups={pickaxey=2,building_block=1},
|
||||
sounds=mcl_sounds.node_sound_metal_defaults(),
|
||||
@ -192,7 +192,7 @@ if industrialtest.mclAvailable then
|
||||
end
|
||||
industrialtest.registerToolset=function(material,materialItem,materialDisplayName,config)
|
||||
minetest.register_tool("industrialtest:"..material.."_pickaxe",{
|
||||
description=S(materialDisplayName.." Pickaxe"),
|
||||
description=S("@1 Pickaxe", materialDisplayName),
|
||||
inventory_image="industrialtest_mcl_"..material.."_pickaxe.png",
|
||||
groups={tool=1,pickaxe=1,dig_speed_class=config.digSpeedClass},
|
||||
tool_capabilities={
|
||||
@ -208,7 +208,7 @@ if industrialtest.mclAvailable then
|
||||
}
|
||||
})
|
||||
minetest.register_tool("industrialtest:"..material.."_shovel",{
|
||||
description=S(materialDisplayName.." Shovel"),
|
||||
description=S("@1 Shovel", materialDisplayName),
|
||||
inventory_image="industrialtest_mcl_"..material.."_shovel.png",
|
||||
groups={tool=1,shovel=1,dig_speed_class=config.digSpeedClass},
|
||||
tool_capabilities={
|
||||
@ -260,7 +260,7 @@ if industrialtest.mclAvailable then
|
||||
}
|
||||
})
|
||||
minetest.register_tool("industrialtest:"..material.."_axe",{
|
||||
description=S(materialDisplayName.." Axe"),
|
||||
description=S("@1 Axe", materialDisplayName),
|
||||
inventory_image="industrialtest_mcl_"..material.."_axe.png",
|
||||
groups={tool=1,axe=1,dig_speed_class=config.digSpeedClass},
|
||||
tool_capabilities={
|
||||
@ -277,7 +277,7 @@ if industrialtest.mclAvailable then
|
||||
}
|
||||
})
|
||||
minetest.register_tool("industrialtest:"..material.."_sword",{
|
||||
description=S(materialDisplayName.." Sword"),
|
||||
description=S("@1 Sword", materialDisplayName),
|
||||
inventory_image="industrialtest_mcl_"..material.."_sword.png",
|
||||
groups={weapon=1,sword=1,dig_speed_class=config.digSpeedClass},
|
||||
tool_capabilities={
|
||||
@ -294,7 +294,7 @@ if industrialtest.mclAvailable then
|
||||
}
|
||||
})
|
||||
minetest.register_tool("industrialtest:"..material.."_hoe",{
|
||||
description=S(materialDisplayName.." Hoe"),
|
||||
description=S("@1 Hoe", materialDisplayName),
|
||||
inventory_image="industrialtest_mcl_"..material.."_hoe.png",
|
||||
groups={tool=1,hoe=1},
|
||||
tool_capabilities={
|
||||
@ -552,7 +552,7 @@ if industrialtest.mclAvailable then
|
||||
}
|
||||
})
|
||||
industrialtest.elementKeys.bronzeIngot="industrialtest:bronze_ingot"
|
||||
industrialtest.registerToolset("bronze","bronze_ingot","Bronze",{
|
||||
industrialtest.registerToolset("bronze","bronze_ingot",S("Bronze"),{
|
||||
digSpeedClass=4,
|
||||
dropLevel=4,
|
||||
speed=6,
|
||||
@ -617,22 +617,22 @@ elseif industrialtest.mtgAvailable then
|
||||
|
||||
industrialtest.internal.registerMetal=function(name,displayName,hardness)
|
||||
minetest.register_craftitem("industrialtest:"..name.."_lump",{
|
||||
description=S(displayName.." Lump"),
|
||||
description=S("@1 Lump", displayName),
|
||||
inventory_image="industrialtest_mtg_"..name.."_lump.png"
|
||||
})
|
||||
minetest.register_craftitem("industrialtest:"..name.."_ingot",{
|
||||
description=S(displayName.." Ingot"),
|
||||
description=S("@1 Ingot", displayName),
|
||||
inventory_image="industrialtest_mtg_"..name.."_ingot.png"
|
||||
})
|
||||
minetest.register_node("industrialtest:stone_with_"..name,{
|
||||
description=S(displayName.." Ore"),
|
||||
description=S("@1 Ore", displayName),
|
||||
tiles={"default_stone.png^industrialtest_mtg_stone_with_"..name..".png"},
|
||||
sounds=default.node_sound_stone_defaults(),
|
||||
drop="industrialtest:"..name.."_lump",
|
||||
groups={cracky=hardness},
|
||||
})
|
||||
minetest.register_node("industrialtest:"..name.."_block",{
|
||||
description=S("Block of "..displayName),
|
||||
description=S("Block of @1", displayName),
|
||||
tiles={"industrialtest_"..name.."_block.png"},
|
||||
groups={cracky=hardness,level=2},
|
||||
sounds=default.node_sound_metal_defaults(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user
The reason why I wrote these function calls this way is because in some languages (like Polish) words have to be translated together, otherwise sometimes you will get incorrect results. For example "proszek" means "dust" and "miedź" is "copper", translating these words separately and concatenating into single string would result in "Miedź proszek" which is not right at all. Correct translation would be "Miedziany proszek".
I understand, but using the correct method could benefit the translators, in addition, this allows the @1 or @2 to be ordered correctly for each language in the translation templates, for example in Polish you can alternate "@2 something @1 " and in Spanish we order it "@1 something @2" in their respective translation templates. Or even skip "@1" and type the word directly.
Consider using the correct S() function calls, I think it is beneficial.
Since the resulting lookup string passed to
S
contains both words you can translate it however you want.