New translation system, part 9: Items, part 5

This commit is contained in:
Wuzzy 2019-03-08 00:46:35 +01:00
parent 47c817d75a
commit f9b557c2ba
13 changed files with 199 additions and 174 deletions

View file

@ -1,3 +1,5 @@
local S = minetest.get_translator("mcl_stairs")
-- Core mcl_stairs API
-- Wrapper around mintest.pointed_thing_to_face_pos.
@ -100,7 +102,7 @@ function mcl_stairs.register_stair(subname, recipeitem, groups, images, descript
minetest.register_node(":mcl_stairs:stair_" .. subname, {
description = description,
_doc_items_longdesc = "Stairs are useful to reach higher places by walking over them; jumping is not required. Placing stairs in a corner pattern will create corner stairs. Stairs placed on the bottom or at the upper half of the side of a block will be placed upside down.",
_doc_items_longdesc = S("Stairs are useful to reach higher places by walking over them; jumping is not required. Placing stairs in a corner pattern will create corner stairs. Stairs placed on the bottom or at the upper half of the side of a block will be placed upside down."),
drawtype = "mesh",
mesh = "stairs_stair.obj",
tiles = images,
@ -188,13 +190,13 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti
-- Automatically generate double slab description
if not double_description then
double_description = string.format("Double %s", description)
double_description = S("Double @1", description)
minetest.log("warning", "[stairs] No explicit description for double slab '"..double_slab.."' added. Using auto-generated description.")
end
groups.slab = 1
groups.building_block = 1
local longdesc = "Slabs are half as high as their full block counterparts and occupy either the lower or upper part of a block, depending on how it was placed. Slabs can be easily stepped on without needing to jump. When a slab is placed on another slab of the same type, a double slab is created."
local longdesc = S("Slabs are half as high as their full block counterparts and occupy either the lower or upper part of a block, depending on how it was placed. Slabs can be easily stepped on without needing to jump. When a slab is placed on another slab of the same type, a double slab is created.")
local slabdef = {
description = description,
@ -258,7 +260,7 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti
topdef.groups.slab_top = 1
topdef.groups.not_in_creative_inventory = 1
topdef.groups.not_in_craft_guide = 1
topdef.description = string.format("Upper %s", description)
topdef.description = S("Upper @1", description)
topdef._doc_items_create_entry = false
topdef._doc_items_longdesc = nil
topdef._doc_items_usagehelp = nil
@ -283,7 +285,7 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti
dgroups.double_slab = 1
minetest.register_node(":"..double_slab, {
description = double_description,
_doc_items_longdesc = "Double slabs are full blocks which are created by placing two slabs of the same kind on each other.",
_doc_items_longdesc = S("Double slabs are full blocks which are created by placing two slabs of the same kind on each other."),
tiles = images,
is_ground_content = false,
groups = dgroups,

View file

@ -3,13 +3,15 @@
-- slabs actually take slightly longer to be dug than their stair counterparts.
-- Note sure if it is a good idea to preserve this oddity.
local S = minetest.get_translator("mcl_stairs")
local woods = {
{ "wood", "default_wood.png", "Oak Wood Stairs", "Oak Wood Slab", "Double Oak Wood Slab" },
{ "junglewood", "default_junglewood.png", "Jungle Wood Stairs", "Jungle Wood Slab", "Double Jungle Wood Slab" },
{ "acaciawood", "default_acacia_wood.png", "Acacia Wood Stairs", "Acacia Wood Slab", "Double Acacia Wood Slab" },
{ "sprucewood", "mcl_core_planks_spruce.png", "Spruce Wood Stairs", "Spruce Wood Slab", "Double Spruce Wood Slab" },
{ "birchwood", "mcl_core_planks_birch.png", "Birch Wood Stairs", "Birch Wood Slab", "Double Birch Wood Slab" },
{ "darkwood", "mcl_core_planks_big_oak.png", "Dark Oak Wood Stairs", "Dark Oak Wood Slab", "Double Dark Oak Wood Slab" },
{ "wood", "default_wood.png", S("Oak Wood Stairs"), S("Oak Wood Slab"), S("Double Oak Wood Slab") },
{ "junglewood", "default_junglewood.png", S("Jungle Wood Stairs"), S("Jungle Wood Slab"), S("Double Jungle Wood Slab") },
{ "acaciawood", "default_acacia_wood.png", S("Acacia Wood Stairs"), S("Acacia Wood Slab"), S("Double Acacia Wood Slab") },
{ "sprucewood", "mcl_core_planks_spruce.png", S("Spruce Wood Stairs"), S("Spruce Wood Slab"), S("Double Spruce Wood Slab") },
{ "birchwood", "mcl_core_planks_birch.png", S("Birch Wood Stairs"), S("Birch Wood Slab"), S("Double Birch Wood Slab") },
{ "darkwood", "mcl_core_planks_big_oak.png", S("Dark Oak Wood Stairs"), S("Dark Oak Wood Slab"), S("Double Dark Oak Wood Slab") },
}
for w=1, #woods do
@ -30,131 +32,131 @@ for w=1, #woods do
wood[5])
end
mcl_stairs.register_stair_and_slab_simple("stone_rough", "mcl_core:stone", "Stone Stairs", "Stone Slab", "Double Stone Slab")
mcl_stairs.register_stair_and_slab_simple("stone_rough", "mcl_core:stone", S("Stone Stairs"), S("Stone Slab"), S("Double Stone Slab"))
mcl_stairs.register_slab("stone", "mcl_core:stone_smooth",
{pickaxey=1, material_stone=1},
{"mcl_stairs_stone_slab_top.png", "mcl_stairs_stone_slab_top.png", "mcl_stairs_stone_slab_side.png"},
"Polished Stone Slab",
mcl_sounds.node_sound_stone_defaults(), 2, "Double Polished Stone Slab")
S("Polished Stone Slab"),
mcl_sounds.node_sound_stone_defaults(), 2, S("Double Polished Stone Slab"))
mcl_stairs.register_stair_and_slab_simple("andesite", "mcl_core:andesite", "Andesite Stairs", "Andesite Slab", "Double Andesite Slab")
mcl_stairs.register_stair_and_slab_simple("granite", "mcl_core:granite", "Granite Stairs", "Granite Slab", "Double Granite Slab")
mcl_stairs.register_stair_and_slab_simple("diorite", "mcl_core:diorite", "Diorite Stairs", "Diorite Slab", "Double Diorite Slab")
mcl_stairs.register_stair_and_slab_simple("andesite", "mcl_core:andesite", S("Andesite Stairs"), S("Andesite Slab"), S("Double Andesite Slab"))
mcl_stairs.register_stair_and_slab_simple("granite", "mcl_core:granite", S("Granite Stairs"), S("Granite Slab"), S("Double Granite Slab"))
mcl_stairs.register_stair_and_slab_simple("diorite", "mcl_core:diorite", S("Diorite Stairs"), S("Diorite Slab"), S("Double Diorite Slab"))
mcl_stairs.register_stair_and_slab_simple("cobble", "mcl_core:cobble", "Cobblestone Stairs", "Cobblestone Slab", "Double Cobblestone Slab")
mcl_stairs.register_stair_and_slab_simple("mossycobble", "mcl_core:mossycobble", "Moss Stone Stairs", "Moss Stone Slab", "Double Moss Stone Slab")
mcl_stairs.register_stair_and_slab_simple("cobble", "mcl_core:cobble", S("Cobblestone Stairs"), S("Cobblestone Slab"), S("Double Cobblestone Slab"))
mcl_stairs.register_stair_and_slab_simple("mossycobble", "mcl_core:mossycobble", S("Moss Stone Stairs"), S("Moss Stone Slab"), S("Double Moss Stone Slab"))
mcl_stairs.register_stair_and_slab_simple("brick_block", "mcl_core:brick_block", "Brick Stairs", "Brick Slab", "Double Brick Slab")
mcl_stairs.register_stair_and_slab_simple("brick_block", "mcl_core:brick_block", S("Brick Stairs"), S("Brick Slab"), S("Double Brick Slab"))
mcl_stairs.register_stair("sandstone", "group:sandstone",
{pickaxey=1, material_stone=1},
{"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"},
"Sandstone Stairs",
S("Sandstone Stairs"),
mcl_sounds.node_sound_stone_defaults(), 0.8, nil, "mcl_core:sandstone")
mcl_stairs.register_slab("sandstone", "group:sandstone",
{pickaxey=1, material_stone=1},
{"mcl_core_sandstone_top.png", "mcl_core_sandstone_bottom.png", "mcl_core_sandstone_normal.png"},
"Sandstone Slab",
mcl_sounds.node_sound_stone_defaults(), 2, "Double Sandstone Slab", "mcl_core:sandstone")
mcl_stairs.register_stair_and_slab_simple("sandstonesmooth2", "mcl_core:sandstonesmooth2", "Smooth Sandstone Stairs", "Smooth Sandstone Slab", "Double Smooth Sandstone Slab")
S("Sandstone Slab"),
mcl_sounds.node_sound_stone_defaults(), 2, S("Double Sandstone Slab"), "mcl_core:sandstone")
mcl_stairs.register_stair_and_slab_simple("sandstonesmooth2", "mcl_core:sandstonesmooth2", S("Smooth Sandstone Stairs"), S("Smooth Sandstone Slab"), S("Double Smooth Sandstone Slab"))
mcl_stairs.register_stair("redsandstone", "group:redsandstone",
{pickaxey=1, material_stone=1},
{"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"},
"Red Sandstone Stairs",
S("Red Sandstone Stairs"),
mcl_sounds.node_sound_stone_defaults(), 0.8, nil, "mcl_core:redsandstone")
mcl_stairs.register_slab("redsandstone", "group:redsandstone",
{pickaxey=1, material_stone=1},
{"mcl_core_red_sandstone_top.png", "mcl_core_red_sandstone_bottom.png", "mcl_core_red_sandstone_normal.png"},
"Red Sandstone Slab",
mcl_sounds.node_sound_stone_defaults(), 2, "Double Red Sandstone Slab", "mcl_core:redsandstone")
mcl_stairs.register_stair_and_slab_simple("redsandstonesmooth2", "mcl_core:redsandstonesmooth2", "Smooth Red Sandstone Stairs", "Smooth Red Sandstone Slab", "Double Smooth Red Sandstone Slab")
S("Red Sandstone Slab"),
mcl_sounds.node_sound_stone_defaults(), 2, S("Double Red Sandstone Slab"), "mcl_core:redsandstone")
mcl_stairs.register_stair_and_slab_simple("redsandstonesmooth2", "mcl_core:redsandstonesmooth2", S("Smooth Red Sandstone Stairs"), S("Smooth Red Sandstone Slab"), S("Double Smooth Red Sandstone Slab"))
-- Intentionally not group:stonebrick because of mclx_stairs
mcl_stairs.register_stair("stonebrick", "mcl_core:stonebrick",
{pickaxey=1, material_stone=1},
{"default_stone_brick.png"},
"Stone Bricks Stairs",
S("Stone Bricks Stairs"),
mcl_sounds.node_sound_stone_defaults(), 1.5, nil, "mcl_core:stonebrick")
mcl_stairs.register_slab("stonebrick", "mcl_core:stonebrick",
{pickaxey=1, material_stone=1},
{"default_stone_brick.png"},
"Stone Bricks Slab",
mcl_sounds.node_sound_stone_defaults(), 2, "Double Stone Bricks Slab", "mcl_core:stonebrick")
S("Stone Bricks Slab"),
mcl_sounds.node_sound_stone_defaults(), 2, S("Double Stone Bricks Slab"), "mcl_core:stonebrick")
mcl_stairs.register_stair("quartzblock", "group:quartz_block",
{pickaxey=1, material_stone=1},
{"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"},
"Quartz Stairs",
S("Quartz Stairs"),
mcl_sounds.node_sound_stone_defaults(), 0.8, nil, "mcl_nether:quartz_block")
mcl_stairs.register_slab("quartzblock", "group:quartz_block",
{pickaxey=1, material_stone=1},
{"mcl_nether_quartz_block_top.png", "mcl_nether_quartz_block_bottom.png", "mcl_nether_quartz_block_side.png"},
"Quartz Slab",
mcl_sounds.node_sound_stone_defaults(), 2, "Double Quartz Slab", "mcl_nether:quartz_block")
S("Quartz Slab"),
mcl_sounds.node_sound_stone_defaults(), 2, S("Double Quartz Slab"), "mcl_nether:quartz_block")
mcl_stairs.register_stair_and_slab_simple("quartz_smooth", "mcl_nether:quartz_smooth", "Smooth Quartz Stairs", "Smooth Quartz Slab", "Double Smooth Quartz Slab")
mcl_stairs.register_stair_and_slab_simple("quartz_smooth", "mcl_nether:quartz_smooth", S("Smooth Quartz Stairs"), S("Smooth Quartz Slab"), S("Double Smooth Quartz Slab"))
mcl_stairs.register_stair_and_slab("nether_brick", "mcl_nether:nether_brick",
{pickaxey=1, material_stone=1},
{"mcl_nether_nether_brick.png"},
"Nether Brick Stairs",
"Nether Brick Slab",
S("Nether Brick Stairs"),
S("Nether Brick Slab"),
mcl_sounds.node_sound_stone_defaults(),
2,
"Double Nether Brick Slab")
S("Double Nether Brick Slab"))
mcl_stairs.register_stair_and_slab("red_nether_brick", "mcl_nether:red_nether_brick",
{pickaxey=1, material_stone=1},
{"mcl_nether_red_nether_brick.png"},
"Red Nether Brick Stairs",
"Red Nether Brick Slab",
S("Red Nether Brick Stairs"),
S("Red Nether Brick Slab"),
mcl_sounds.node_sound_stone_defaults(),
2,
"Double Red Nether Brick Slab")
S("Double Red Nether Brick Slab"))
mcl_stairs.register_stair_and_slab_simple("end_bricks", "mcl_end:end_bricks", "End Stone Brick Stairs", "End Stone Brick Slab", "Double End Stone Brick Slab")
mcl_stairs.register_stair_and_slab_simple("end_bricks", "mcl_end:end_bricks", S("End Stone Brick Stairs"), S("End Stone Brick Slab"), S("Double End Stone Brick Slab"))
mcl_stairs.register_stair("purpur_block", "group:purpur_block",
{pickaxey=1, material_stone=1},
{"mcl_end_purpur_block.png"},
"Purpur Stairs",
S("Purpur Stairs"),
mcl_sounds.node_sound_stone_defaults(),
1.5)
mcl_stairs.register_slab("purpur_block", "group:purpur_block",
{pickaxey=1, material_stone=1},
{"mcl_end_purpur_block.png"},
"Purpur Slab",
S("Purpur Slab"),
mcl_sounds.node_sound_stone_defaults(),
2,
"Double Purpur Slab")
S("Double Purpur Slab"))
mcl_stairs.register_stair_and_slab_simple("prismarine", "mcl_ocean:prismarine", "Prismarine Stairs", "Prismarine Slab", "Double Prismarine Slab")
mcl_stairs.register_stair_and_slab_simple("prismarine", "mcl_ocean:prismarine", S("Prismarine Stairs"), S("Prismarine Slab"), S("Double Prismarine Slab"))
mcl_stairs.register_stair_and_slab_simple("prismarine_brick", "mcl_ocean:prismarine_brick", "Prismarine Brick Stairs", "Prismarine Brick Slab", "Double Prismarine Brick Slab")
mcl_stairs.register_stair_and_slab_simple("prismarine_dark", "mcl_ocean:prismarine_dark", "Dark Prismarine Stairs", "Dark Prismarine Slab", "Double Dark Prismarine Slab")
mcl_stairs.register_stair_and_slab_simple("prismarine_brick", "mcl_ocean:prismarine_brick", S("Prismarine Brick Stairs"), S("Prismarine Brick Slab"), S("Double Prismarine Brick Slab"))
mcl_stairs.register_stair_and_slab_simple("prismarine_dark", "mcl_ocean:prismarine_dark", S("Dark Prismarine Stairs"), S("Dark Prismarine Slab"), S("Double Dark Prismarine Slab"))
mcl_stairs.register_slab("andesite_smooth", "mcl_core:andesite_smooth", {pickaxey=1}, {"mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, "Polished Andesite Slab", nil, nil, "Double Polished Andesite Slab")
mcl_stairs.register_stair("andesite_smooth", "mcl_core:andesite_smooth", {pickaxey=1}, {"mcl_stairs_andesite_smooth_slab.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, "Polished Andesite Stairs", nil, nil, "woodlike")
mcl_stairs.register_slab("andesite_smooth", "mcl_core:andesite_smooth", {pickaxey=1}, {"mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, S("Polished Andesite Slab"), nil, nil, S("Double Polished Andesite Slab"))
mcl_stairs.register_stair("andesite_smooth", "mcl_core:andesite_smooth", {pickaxey=1}, {"mcl_stairs_andesite_smooth_slab.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_core_andesite_smooth.png", "mcl_stairs_andesite_smooth_slab.png"}, S("Polished Andesite Stairs"), nil, nil, "woodlike")
mcl_stairs.register_slab("granite_smooth", "mcl_core:granite_smooth", {pickaxey=1}, {"mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, "Polished Granite Slab", nil, nil, "Double Polished Granite Slab")
mcl_stairs.register_stair("granite_smooth", "mcl_core:granite_smooth", {pickaxey=1}, {"mcl_stairs_granite_smooth_slab.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, "Polished Granite Stairs", nil, nil, "woodlike")
mcl_stairs.register_slab("granite_smooth", "mcl_core:granite_smooth", {pickaxey=1}, {"mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, S("Polished Granite Slab"), nil, nil, S("Double Polished Granite Slab"))
mcl_stairs.register_stair("granite_smooth", "mcl_core:granite_smooth", {pickaxey=1}, {"mcl_stairs_granite_smooth_slab.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_core_granite_smooth.png", "mcl_stairs_granite_smooth_slab.png"}, S("Polished Granite Stairs"), nil, nil, "woodlike")
mcl_stairs.register_slab("diorite_smooth", "mcl_core:diorite_smooth", {pickaxey=1}, {"mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, "Polished Diorite Slab", nil, nil, "Double Polished Diorite Slab")
mcl_stairs.register_stair("diorite_smooth", "mcl_core:diorite_smooth", {pickaxey=1}, {"mcl_stairs_diorite_smooth_slab.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, "Polished Diorite Stairs", nil, nil, "woodlike")
mcl_stairs.register_slab("diorite_smooth", "mcl_core:diorite_smooth", {pickaxey=1}, {"mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, S("Polished Diorite Slab"), nil, nil, S("Double Polished Diorite Slab"))
mcl_stairs.register_stair("diorite_smooth", "mcl_core:diorite_smooth", {pickaxey=1}, {"mcl_stairs_diorite_smooth_slab.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_core_diorite_smooth.png", "mcl_stairs_diorite_smooth_slab.png"}, S("Polished Diorite Stairs"), nil, nil, "woodlike")
mcl_stairs.register_stair("stonebrickmossy", "mcl_core:stonebrickmossy",
{pickaxey=1},
{"mcl_core_stonebrick_mossy.png"},
"Mossy Stone Brick Stairs",
S("Mossy Stone Brick Stairs"),
mcl_sounds.node_sound_stone_defaults(), 1.5, nil, "mcl_core:stonebrickmossy")
mcl_stairs.register_slab("stonebrickmossy", "mcl_core:stonebrickmossy",
{pickaxey=1},
{"mcl_core_stonebrick_mossy.png"},
"Mossy Stone Brick Slab",
mcl_sounds.node_sound_stone_defaults(), 2, "Double Mossy Stone Brick Slab", "mcl_core:stonebrickmossy")
S("Mossy Stone Brick Slab"),
mcl_sounds.node_sound_stone_defaults(), 2, S("Double Mossy Stone Brick Slab"), "mcl_core:stonebrickmossy")