some fixes #8

Closed
usrib wants to merge 2 commits from usrib/industrialtest:mcla-support into master
4 changed files with 160 additions and 20 deletions

View File

@ -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),
Review

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".

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".
Review

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.

> 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.
Review

Since the resulting lookup string passed to S contains both words you can translate it however you want.

Since the resulting lookup string passed to `S` contains both words you can translate it however you want.
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

View File

@ -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"

View File

@ -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(),

140
locale/template.txt Normal file
View File

@ -0,0 +1,140 @@
# textdomain: industrialtest
@1@n@2 / @3 EU=
@1@n@2 / @3 mB=
@1 Dust=
@1 Cell=
@1 Cable=
Insulated @1 Cable=
Raw @1=
@1 Ingot=
@1 Ore=
Deepslate with @1=
Raw @1 Block=
Block of @1=
@1 Pickaxe=
@1 Shovel=
@1 Axe=
@1 Sword=
@1 Hoe=
Bronze Ingot=
Bronze Nugget=
Bronze=
Block of Bronze=
@1 Lump=
RE-Battery=
Advanced RE-Battery=
Energy Crystal=
Lapotron Crystal=
Refined Iron Ingot=
Mixed Metal Ingot=
Sticky Resin=
Rubber=
Raw Carbon Fibre=
Raw Carbon Mesh=
Hydrated Coal Dust=
Hydrated Coal=
Bronze Plate=
Copper Plate=
Advanced Alloy=
Carbon Plate=
Tin Plate=
Lead Plate=
Empty Cell=
Uranium Cell=
Coolant Cell=
Bio Cell=
Biofuel Cell=
Hydrated Coal Cell=
Coalfuel Cell=
Electronic Circuit=
Advanced Electronic Circuit=
Scrap=
UU-Matter=
Plantball=
Compressed Plantball=
Fuel Can=
Cable Former=
Canning Machine=
BatBox Chargepad=
CESU Chargepad=
MFE Chargepad=
MFSU Chargepad=
Charge=
Discharge=
Compressor=
Electric Furnace=
Extractor=
Geothermal Generator=
Water Mill=
Generator=
Heat: @1 %=
Induction Furnace=
Iron Furnace=
Macerator=
Mass Fabricator=
Start=
Stop=
Nuclear Reactor=
Nuclear Reactor Chamber=
BatBox=
CESU=
MFE=
MFSU=
Recycler=
Don't maintain speed=
Maintain speed=
Speed: @1=
Rotary Macerator=
Solar Panel=
LV Solar Array=
MV Solar Array=
HV Solar Array=
Tool Workshop=
LV Transformer=
MV Transformer=
HV Transformer=
EV Transformer=
Wind Mill=
Machine Block=
Advanced Machine Block=
Rubber Wood=
Rubber Leaves=
Rubber Sapling=
BatPack=
LapPack=
Electric Chainsaw=
Diamond Electric Chainsaw=
Electric Drill=
Diamond Electric Drill=
Electric Hoe=
Diamond Electric Hoe=
Electric Saber=
Diamond Electric Saber=
Jetpack=
Electric Jetpack=
Mining Laser (Mode @1)=
Mining Laser (Mode 1)=
Nano Helmet=
Nano Bodyarmor=
Nano Leggings=
Nano Boots=
Solar Helmet=
Static Boots=
Treetap=
Electric Treetap=
Wrench=
Electric Wrench=
Overclocker Upgrade=
Transformer Upgrade=
Power Storage Upgrade=
Power Storage Inspector=
Power Capacity: @1=
Power Flow: @1=
Power Amount: @1=
Power IO Config: @1=
Power Capacity=
Power Flow=
Power Amount=
Power IO Config=
Update=
Connections:=