1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-22 23:10:17 +01:00

Fix and improve translation strings (#2471)

This commit is contained in:
sfan5 2019-09-12 19:03:10 +02:00 committed by GitHub
parent ea992bdace
commit e4adb01fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 387 additions and 166 deletions

View File

@ -726,27 +726,29 @@ delivered with Minetest Game, to keep them compatible with other mods.
* `sounds`: See [#Default sounds] * `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]
`stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds, worldaligntex)` `stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds, worldaligntex, full_description)`
* Registers an inner corner stair * Registers an inner corner stair
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_inner_subname" * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_inner_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil`
* `groups`: See [Known damage and digging time defining groups] * `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition] * `images`: See [Tile definition]
* `description`: Used for the description field in the stair's definition * `description`: Used for the description field in the stair's definition with "Inner" prepended
* `sounds`: See [#Default sounds] * `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]
* `full_description`: Overrides the description, bypassing string concatenation. This is useful for translation. (optional)
`stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds, worldaligntex)` `stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds, worldaligntex, full_description)`
* Registers an outer corner stair * Registers an outer corner stair
* `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_outer_subname" * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_outer_subname"
* `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil`
* `groups`: See [Known damage and digging time defining groups] * `groups`: See [Known damage and digging time defining groups]
* `images`: See [Tile definition] * `images`: See [Tile definition]
* `description`: Used for the description field in the stair's definition * `description`: Used for the description field in the stair's definition with "Outer" prepended
* `sounds`: See [#Default sounds] * `sounds`: See [#Default sounds]
* `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition]
* `full_description`: Overrides the description, bypassing string concatenation. This is useful for translation. (optional)
`stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds, worldaligntex)` `stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds, worldaligntex)`

View File

@ -59,7 +59,7 @@ minetest.after(4.7, cyclic_update)
-- Binoculars item -- Binoculars item
minetest.register_craftitem("binoculars:binoculars", { minetest.register_craftitem("binoculars:binoculars", {
description = S("Binoculars\nUse with 'Zoom' key"), description = S("Binoculars") .. "\n" .. S("Use with 'Zoom' key"),
inventory_image = "binoculars_binoculars.png", inventory_image = "binoculars_binoculars.png",
stack_max = 1, stack_max = 1,

View File

@ -154,13 +154,13 @@ function boat.on_step(self, dtime)
if ctrl.up and ctrl.down then if ctrl.up and ctrl.down then
if not self.auto then if not self.auto then
self.auto = true self.auto = true
minetest.chat_send_player(self.driver, S("[boats] Cruise on")) minetest.chat_send_player(self.driver, S("Boat cruise mode on"))
end end
elseif ctrl.down then elseif ctrl.down then
self.v = self.v - dtime * 1.8 self.v = self.v - dtime * 1.8
if self.auto then if self.auto then
self.auto = false self.auto = false
minetest.chat_send_player(self.driver, S("[boats] Cruise off")) minetest.chat_send_player(self.driver, S("Boat cruise mode off"))
end end
elseif ctrl.up or self.auto then elseif ctrl.up or self.auto then
self.v = self.v + dtime * 1.8 self.v = self.v + dtime * 1.8

View File

@ -269,7 +269,7 @@ minetest.register_on_dieplayer(function(player)
meta:set_string("owner", player_name) meta:set_string("owner", player_name)
if share_bones_time ~= 0 then if share_bones_time ~= 0 then
meta:set_string("infotext", S("@1's fresh bones.", player_name)) meta:set_string("infotext", S("@1's fresh bones", player_name))
if share_bones_time_early == 0 or not minetest.is_protected(pos, player_name) then if share_bones_time_early == 0 or not minetest.is_protected(pos, player_name) then
meta:set_int("time", 0) meta:set_int("time", 0)
@ -279,6 +279,6 @@ minetest.register_on_dieplayer(function(player)
minetest.get_node_timer(pos):start(10) minetest.get_node_timer(pos):start(10)
else else
meta:set_string("infotext", S("@1's bones.", player_name)) meta:set_string("infotext", S("@1's bones", player_name))
end end
end) end)

View File

@ -1,13 +1,13 @@
-- butrerflies/init.lua -- butterflies/init.lua
-- Load support for MT game translation. -- Load support for MT game translation.
local S = minetest.get_translator("butterflies") local S = minetest.get_translator("butterflies")
-- register butterflies -- register butterflies
local butter_list = { local butter_list = {
{"white", S("White")}, {"white", S("White Butterfly")},
{"red", S("Red")}, {"red", S("Red Butterfly")},
{"violet", S("Violet")} {"violet", S("Violet Butterfly")}
} }
for i in ipairs (butter_list) do for i in ipairs (butter_list) do
@ -15,7 +15,7 @@ for i in ipairs (butter_list) do
local desc = butter_list[i][2] local desc = butter_list[i][2]
minetest.register_node("butterflies:butterfly_"..name, { minetest.register_node("butterflies:butterfly_"..name, {
description = S("@1 Butterfly", desc), description = desc,
drawtype = "plantlike", drawtype = "plantlike",
tiles = {{ tiles = {{
name = "butterflies_butterfly_"..name.."_animated.png", name = "butterflies_butterfly_"..name.."_animated.png",
@ -61,10 +61,9 @@ for i in ipairs (butter_list) do
}) })
minetest.register_node("butterflies:hidden_butterfly_"..name, { minetest.register_node("butterflies:hidden_butterfly_"..name, {
description = S("Hidden @1 Butterfly", desc),
drawtype = "airlike", drawtype = "airlike",
inventory_image = "insects_butterfly_"..name..".png", inventory_image = "butterflies_butterfly_"..name..".png",
wield_image = "insects_butterfly_"..name..".png", wield_image = "butterflies_butterfly_"..name..".png",
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,

View File

@ -388,7 +388,7 @@ end
minetest.register_entity("carts:cart", cart_entity) minetest.register_entity("carts:cart", cart_entity)
minetest.register_craftitem("carts:cart", { minetest.register_craftitem("carts:cart", {
description = S("Cart (Sneak+Click to pick up)"), description = S("Cart") .. "\n" .. S("(Sneak+Click to pick up)"),
inventory_image = minetest.inventorycube("carts_cart_top.png", "carts_cart_side.png", "carts_cart_side.png"), inventory_image = minetest.inventorycube("carts_cart_top.png", "carts_cart_side.png", "carts_cart_side.png"),
wield_image = "carts_cart_side.png", wield_image = "carts_cart_side.png",
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)

View File

@ -165,7 +165,7 @@ minetest.register_craftitem("default:book", {
}) })
minetest.register_craftitem("default:book_written", { minetest.register_craftitem("default:book_written", {
description = S("Book With Text"), description = S("Book with Text"),
inventory_image = "default_book_written.png", inventory_image = "default_book_written.png",
groups = {book = 1, not_in_creative_inventory = 1, flammable = 3}, groups = {book = 1, not_in_creative_inventory = 1, flammable = 3},
stack_max = 1, stack_max = 1,

View File

@ -226,20 +226,20 @@ local function furnace_node_timer(pos, elapsed)
end end
local fuel_state = S("Empty") local fuel_state = S("Empty")
local active = "inactive" local active = false
local result = false local result = false
if fuel_totaltime ~= 0 then if fuel_totaltime ~= 0 then
active = "active" active = true
local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100)
fuel_state = fuel_percent .. "%" fuel_state = S("@1%", fuel_percent)
formspec = default.get_furnace_active_formspec(fuel_percent, item_percent) formspec = default.get_furnace_active_formspec(fuel_percent, item_percent)
swap_node(pos, "default:furnace_active") swap_node(pos, "default:furnace_active")
-- make sure timer restarts automatically -- make sure timer restarts automatically
result = true result = true
else else
if not fuellist[1]:is_empty() then if not fuellist[1]:is_empty() then
fuel_state = "0%" fuel_state = S("@1%", 0)
end end
formspec = default.get_furnace_inactive_formspec() formspec = default.get_furnace_inactive_formspec()
swap_node(pos, "default:furnace") swap_node(pos, "default:furnace")
@ -247,9 +247,14 @@ local function furnace_node_timer(pos, elapsed)
minetest.get_node_timer(pos):stop() minetest.get_node_timer(pos):stop()
end end
-- local infotext = "Furnace " .. active .. "\n(Item: " .. item_state ..
-- "; Fuel: " .. fuel_state .. ")" local infotext
local infotext = S("Furnace @1 \n(Item: @2; Fuel: @3)", active, item_state, fuel_state) if active then
infotext = S("Furnace active")
else
infotext = S("Furnace inactive")
end
infotext = infotext .. "\n" .. S("(Item: @1; Fuel: @2)", item_state, fuel_state)
-- --
-- Set meta values -- Set meta values

View File

@ -513,14 +513,14 @@ minetest.register_node("default:dirt_with_coniferous_litter", {
}) })
minetest.register_node("default:dry_dirt", { minetest.register_node("default:dry_dirt", {
description = "Dry Dirt", description = S("Dry Dirt"),
tiles = {"default_dry_dirt.png"}, tiles = {"default_dry_dirt.png"},
groups = {crumbly = 3, soil = 1}, groups = {crumbly = 3, soil = 1},
sounds = default.node_sound_dirt_defaults(), sounds = default.node_sound_dirt_defaults(),
}) })
minetest.register_node("default:dry_dirt_with_dry_grass", { minetest.register_node("default:dry_dirt_with_dry_grass", {
description = "Dry Dirt with Dry Grass", description = S("Dry Dirt with Dry Grass"),
tiles = {"default_dry_grass.png", "default_dry_dirt.png", tiles = {"default_dry_grass.png", "default_dry_dirt.png",
{name = "default_dry_dirt.png^default_dry_grass_side.png", {name = "default_dry_dirt.png^default_dry_grass_side.png",
tileable_vertical = false}}, tileable_vertical = false}},
@ -2556,7 +2556,7 @@ minetest.register_node("default:bookshelf", {
local function register_sign(material, desc, def) local function register_sign(material, desc, def)
minetest.register_node("default:sign_wall_" .. material, { minetest.register_node("default:sign_wall_" .. material, {
description = S("@1 Sign", desc), description = desc,
drawtype = "nodebox", drawtype = "nodebox",
tiles = {"default_sign_wall_" .. material .. ".png"}, tiles = {"default_sign_wall_" .. material .. ".png"},
inventory_image = "default_sign_" .. material .. ".png", inventory_image = "default_sign_" .. material .. ".png",
@ -2605,12 +2605,12 @@ local function register_sign(material, desc, def)
}) })
end end
register_sign("wood", S("Wooden"), { register_sign("wood", S("Wooden Sign"), {
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3} groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
}) })
register_sign("steel", S("Steel"), { register_sign("steel", S("Steel Sign"), {
sounds = default.node_sound_metal_defaults(), sounds = default.node_sound_metal_defaults(),
groups = {cracky = 2, attached_node = 1} groups = {cracky = 2, attached_node = 1}
}) })

View File

@ -8,21 +8,21 @@ local S = minetest.get_translator("dye")
-- Make dye names and descriptions available globally -- Make dye names and descriptions available globally
dye.dyes = { dye.dyes = {
{"white", S("White")}, {"white", "White"},
{"grey", S("Grey")}, {"grey", "Grey"},
{"dark_grey", S("Dark Grey")}, {"dark_grey", "Dark Grey"},
{"black", S("Black")}, {"black", "Black"},
{"violet", S("Violet")}, {"violet", "Violet"},
{"blue", S("Blue")}, {"blue", "Blue"},
{"cyan", S("Cyan")}, {"cyan", "Cyan"},
{"dark_green", S("Dark Green")}, {"dark_green", "Dark Green"},
{"green", S("Green")}, {"green", "Green"},
{"yellow", S("Yellow")}, {"yellow", "Yellow"},
{"brown", S("Brown")}, {"brown", "Brown"},
{"orange", S("Orange")}, {"orange", "Orange"},
{"red", S("Red")}, {"red", "Red"},
{"magenta", S("Magenta")}, {"magenta", "Magenta"},
{"pink", S("Pink")}, {"pink", "Pink"},
} }
-- Define items -- Define items
@ -35,7 +35,7 @@ for _, row in ipairs(dye.dyes) do
minetest.register_craftitem("dye:" .. name, { minetest.register_craftitem("dye:" .. name, {
inventory_image = "dye_" .. name .. ".png", inventory_image = "dye_" .. name .. ".png",
description = S("@1 Dye", description), description = S(description .. " Dye"),
groups = groups groups = groups
}) })
@ -103,3 +103,25 @@ for _, mix in pairs(dye_recipes) do
recipe = {"dye:" .. mix[1], "dye:" .. mix[2]}, recipe = {"dye:" .. mix[1], "dye:" .. mix[2]},
}) })
end end
-- Dummy calls to S() to allow translation scripts to detect the strings.
-- To update this run:
-- for _,e in ipairs(dye.dyes) do print(("S(%q)"):format(e[2].." Dye")) end
--[[
S("White Dye")
S("Grey Dye")
S("Dark Grey Dye")
S("Black Dye")
S("Violet Dye")
S("Blue Dye")
S("Cyan Dye")
S("Dark Green Dye")
S("Green Dye")
S("Yellow Dye")
S("Brown Dye")
S("Orange Dye")
S("Red Dye")
S("Magenta Dye")
S("Pink Dye")
--]]

View File

@ -86,7 +86,7 @@ minetest.register_node("farming:soil_wet", {
}) })
minetest.register_node("farming:dry_soil", { minetest.register_node("farming:dry_soil", {
description = "Dry Soil", description = S("Dry Soil"),
tiles = {"default_dry_dirt.png^farming_soil.png", "default_dry_dirt.png"}, tiles = {"default_dry_dirt.png^farming_soil.png", "default_dry_dirt.png"},
drop = "default:dry_dirt", drop = "default:dry_dirt",
groups = {crumbly=3, not_in_creative_inventory=1, soil=2, grassland = 1, field = 1}, groups = {crumbly=3, not_in_creative_inventory=1, soil=2, grassland = 1, field = 1},
@ -99,7 +99,7 @@ minetest.register_node("farming:dry_soil", {
}) })
minetest.register_node("farming:dry_soil_wet", { minetest.register_node("farming:dry_soil_wet", {
description = "Wet Dry Soil", description = S("Wet Dry Soil"),
tiles = {"default_dry_dirt.png^farming_soil_wet.png", "default_dry_dirt.png^farming_soil_wet_side.png"}, tiles = {"default_dry_dirt.png^farming_soil_wet.png", "default_dry_dirt.png^farming_soil_wet_side.png"},
drop = "default:dry_dirt", drop = "default:dry_dirt",
groups = {crumbly=3, not_in_creative_inventory=1, soil=3, wet = 1, grassland = 1, field = 1}, groups = {crumbly=3, not_in_creative_inventory=1, soil=3, wet = 1, grassland = 1, field = 1},

View File

@ -55,7 +55,7 @@ minetest.after(5.3, cyclic_update)
-- Mapping kit item -- Mapping kit item
minetest.register_craftitem("map:mapping_kit", { minetest.register_craftitem("map:mapping_kit", {
description = S("Mapping Kit\nUse with 'Minimap' key"), description = S("Mapping Kit") .. "\n" .. S("Use with 'Minimap' key"),
inventory_image = "map_mapping_kit.png", inventory_image = "map_mapping_kit.png",
stack_max = 1, stack_max = 1,
groups = {flammable = 3}, groups = {flammable = 3},

View File

@ -150,7 +150,7 @@ end
-- Screwdriver -- Screwdriver
minetest.register_tool("screwdriver:screwdriver", { minetest.register_tool("screwdriver:screwdriver", {
description = S("Screwdriver (left-click rotates face, right-click rotates axis)"), description = S("Screwdriver") .. "\n" .. S("(left-click rotates face, right-click rotates axis)"),
inventory_image = "screwdriver.png", inventory_image = "screwdriver.png",
groups = {tool = 1}, groups = {tool = 1},
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)

View File

@ -296,7 +296,7 @@ end
-- Node will be called stairs:stair_inner_<subname> -- Node will be called stairs:stair_inner_<subname>
function stairs.register_stair_inner(subname, recipeitem, groups, images, function stairs.register_stair_inner(subname, recipeitem, groups, images,
description, sounds, worldaligntex) description, sounds, worldaligntex, full_description)
-- Set backface culling and world-aligned textures -- Set backface culling and world-aligned textures
local stair_images = {} local stair_images = {}
for i, image in ipairs(images) do for i, image in ipairs(images) do
@ -320,9 +320,14 @@ function stairs.register_stair_inner(subname, recipeitem, groups, images,
end end
local new_groups = table.copy(groups) local new_groups = table.copy(groups)
new_groups.stair = 1 new_groups.stair = 1
if full_description then
description = full_description
else
description = "Inner " .. description
end
warn_if_exists("stairs:stair_inner_" .. subname) warn_if_exists("stairs:stair_inner_" .. subname)
minetest.register_node(":stairs:stair_inner_" .. subname, { minetest.register_node(":stairs:stair_inner_" .. subname, {
description = S("Inner @1", description), description = description,
drawtype = "nodebox", drawtype = "nodebox",
tiles = stair_images, tiles = stair_images,
paramtype = "light", paramtype = "light",
@ -378,7 +383,7 @@ end
-- Node will be called stairs:stair_outer_<subname> -- Node will be called stairs:stair_outer_<subname>
function stairs.register_stair_outer(subname, recipeitem, groups, images, function stairs.register_stair_outer(subname, recipeitem, groups, images,
description, sounds, worldaligntex) description, sounds, worldaligntex, full_description)
-- Set backface culling and world-aligned textures -- Set backface culling and world-aligned textures
local stair_images = {} local stair_images = {}
for i, image in ipairs(images) do for i, image in ipairs(images) do
@ -402,9 +407,14 @@ function stairs.register_stair_outer(subname, recipeitem, groups, images,
end end
local new_groups = table.copy(groups) local new_groups = table.copy(groups)
new_groups.stair = 1 new_groups.stair = 1
if full_description then
description = full_description
else
description = "Outer " .. description
end
warn_if_exists("stairs:stair_outer_" .. subname) warn_if_exists("stairs:stair_outer_" .. subname)
minetest.register_node(":stairs:stair_outer_" .. subname, { minetest.register_node(":stairs:stair_outer_" .. subname, {
description = S("Outer @1", description), description = description,
drawtype = "nodebox", drawtype = "nodebox",
tiles = stair_images, tiles = stair_images,
paramtype = "light", paramtype = "light",
@ -469,379 +479,392 @@ function stairs.register_stair_and_slab(subname, recipeitem, groups, images,
sounds, worldaligntex) sounds, worldaligntex)
end end
-- Local function so we can apply translations
local function my_register_stair_and_slab(subname, recipeitem, groups, images,
desc_stair, desc_slab, sounds, worldaligntex)
stairs.register_stair(subname, recipeitem, groups, images, S(desc_stair),
sounds, worldaligntex)
stairs.register_stair_inner(subname, recipeitem, groups, images, "",
sounds, worldaligntex, S("Inner " .. desc_stair))
stairs.register_stair_outer(subname, recipeitem, groups, images, "",
sounds, worldaligntex, S("Outer " .. desc_stair))
stairs.register_slab(subname, recipeitem, groups, images, S(desc_slab),
sounds, worldaligntex)
end
-- Register default stairs and slabs -- Register default stairs and slabs
stairs.register_stair_and_slab( my_register_stair_and_slab(
"wood", "wood",
"default:wood", "default:wood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
{"default_wood.png"}, {"default_wood.png"},
S("Wooden Stair"), "Wooden Stair",
S("Wooden Slab"), "Wooden Slab",
default.node_sound_wood_defaults(), default.node_sound_wood_defaults(),
false false
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"junglewood", "junglewood",
"default:junglewood", "default:junglewood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
{"default_junglewood.png"}, {"default_junglewood.png"},
S("Jungle Wood Stair"), "Jungle Wood Stair",
S("Jungle Wood Slab"), "Jungle Wood Slab",
default.node_sound_wood_defaults(), default.node_sound_wood_defaults(),
false false
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"pine_wood", "pine_wood",
"default:pine_wood", "default:pine_wood",
{choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
{"default_pine_wood.png"}, {"default_pine_wood.png"},
S("Pine Wood Stair"), "Pine Wood Stair",
S("Pine Wood Slab"), "Pine Wood Slab",
default.node_sound_wood_defaults(), default.node_sound_wood_defaults(),
false false
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"acacia_wood", "acacia_wood",
"default:acacia_wood", "default:acacia_wood",
{choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
{"default_acacia_wood.png"}, {"default_acacia_wood.png"},
S("Acacia Wood Stair"), "Acacia Wood Stair",
S("Acacia Wood Slab"), "Acacia Wood Slab",
default.node_sound_wood_defaults(), default.node_sound_wood_defaults(),
false false
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"aspen_wood", "aspen_wood",
"default:aspen_wood", "default:aspen_wood",
{choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
{"default_aspen_wood.png"}, {"default_aspen_wood.png"},
S("Aspen Wood Stair"), "Aspen Wood Stair",
S("Aspen Wood Slab"), "Aspen Wood Slab",
default.node_sound_wood_defaults(), default.node_sound_wood_defaults(),
false false
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"stone", "stone",
"default:stone", "default:stone",
{cracky = 3}, {cracky = 3},
{"default_stone.png"}, {"default_stone.png"},
S("Stone Stair"), "Stone Stair",
S("Stone Slab"), "Stone Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"cobble", "cobble",
"default:cobble", "default:cobble",
{cracky = 3}, {cracky = 3},
{"default_cobble.png"}, {"default_cobble.png"},
S("Cobblestone Stair"), "Cobblestone Stair",
S("Cobblestone Slab"), "Cobblestone Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"mossycobble", "mossycobble",
"default:mossycobble", "default:mossycobble",
{cracky = 3}, {cracky = 3},
{"default_mossycobble.png"}, {"default_mossycobble.png"},
S("Mossy Cobblestone Stair"), "Mossy Cobblestone Stair",
S("Mossy Cobblestone Slab"), "Mossy Cobblestone Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"stonebrick", "stonebrick",
"default:stonebrick", "default:stonebrick",
{cracky = 2}, {cracky = 2},
{"default_stone_brick.png"}, {"default_stone_brick.png"},
S("Stone Brick Stair"), "Stone Brick Stair",
S("Stone Brick Slab"), "Stone Brick Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
false false
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"stone_block", "stone_block",
"default:stone_block", "default:stone_block",
{cracky = 2}, {cracky = 2},
{"default_stone_block.png"}, {"default_stone_block.png"},
S("Stone Block Stair"), "Stone Block Stair",
S("Stone Block Slab"), "Stone Block Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"desert_stone", "desert_stone",
"default:desert_stone", "default:desert_stone",
{cracky = 3}, {cracky = 3},
{"default_desert_stone.png"}, {"default_desert_stone.png"},
S("Desert Stone Stair"), "Desert Stone Stair",
S("Desert Stone Slab"), "Desert Stone Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"desert_cobble", "desert_cobble",
"default:desert_cobble", "default:desert_cobble",
{cracky = 3}, {cracky = 3},
{"default_desert_cobble.png"}, {"default_desert_cobble.png"},
S("Desert Cobblestone Stair"), "Desert Cobblestone Stair",
S("Desert Cobblestone Slab"), "Desert Cobblestone Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"desert_stonebrick", "desert_stonebrick",
"default:desert_stonebrick", "default:desert_stonebrick",
{cracky = 2}, {cracky = 2},
{"default_desert_stone_brick.png"}, {"default_desert_stone_brick.png"},
S("Desert Stone Brick Stair"), "Desert Stone Brick Stair",
S("Desert Stone Brick Slab"), "Desert Stone Brick Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
false false
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"desert_stone_block", "desert_stone_block",
"default:desert_stone_block", "default:desert_stone_block",
{cracky = 2}, {cracky = 2},
{"default_desert_stone_block.png"}, {"default_desert_stone_block.png"},
S("Desert Stone Block Stair"), "Desert Stone Block Stair",
S("Desert Stone Block Slab"), "Desert Stone Block Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"sandstone", "sandstone",
"default:sandstone", "default:sandstone",
{crumbly = 1, cracky = 3}, {crumbly = 1, cracky = 3},
{"default_sandstone.png"}, {"default_sandstone.png"},
S("Sandstone Stair"), "Sandstone Stair",
S("Sandstone Slab"), "Sandstone Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"sandstonebrick", "sandstonebrick",
"default:sandstonebrick", "default:sandstonebrick",
{cracky = 2}, {cracky = 2},
{"default_sandstone_brick.png"}, {"default_sandstone_brick.png"},
S("Sandstone Brick Stair"), "Sandstone Brick Stair",
S("Sandstone Brick Slab"), "Sandstone Brick Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
false false
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"sandstone_block", "sandstone_block",
"default:sandstone_block", "default:sandstone_block",
{cracky = 2}, {cracky = 2},
{"default_sandstone_block.png"}, {"default_sandstone_block.png"},
S("Sandstone Block Stair"), "Sandstone Block Stair",
S("Sandstone Block Slab"), "Sandstone Block Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"desert_sandstone", "desert_sandstone",
"default:desert_sandstone", "default:desert_sandstone",
{crumbly = 1, cracky = 3}, {crumbly = 1, cracky = 3},
{"default_desert_sandstone.png"}, {"default_desert_sandstone.png"},
S("Desert Sandstone Stair"), "Desert Sandstone Stair",
S("Desert Sandstone Slab"), "Desert Sandstone Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"desert_sandstone_brick", "desert_sandstone_brick",
"default:desert_sandstone_brick", "default:desert_sandstone_brick",
{cracky = 2}, {cracky = 2},
{"default_desert_sandstone_brick.png"}, {"default_desert_sandstone_brick.png"},
S("Desert Sandstone Brick Stair"), "Desert Sandstone Brick Stair",
S("Desert Sandstone Brick Slab"), "Desert Sandstone Brick Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
false false
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"desert_sandstone_block", "desert_sandstone_block",
"default:desert_sandstone_block", "default:desert_sandstone_block",
{cracky = 2}, {cracky = 2},
{"default_desert_sandstone_block.png"}, {"default_desert_sandstone_block.png"},
S("Desert Sandstone Block Stair"), "Desert Sandstone Block Stair",
S("Desert Sandstone Block Slab"), "Desert Sandstone Block Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"silver_sandstone", "silver_sandstone",
"default:silver_sandstone", "default:silver_sandstone",
{crumbly = 1, cracky = 3}, {crumbly = 1, cracky = 3},
{"default_silver_sandstone.png"}, {"default_silver_sandstone.png"},
S("Silver Sandstone Stair"), "Silver Sandstone Stair",
S("Silver Sandstone Slab"), "Silver Sandstone Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"silver_sandstone_brick", "silver_sandstone_brick",
"default:silver_sandstone_brick", "default:silver_sandstone_brick",
{cracky = 2}, {cracky = 2},
{"default_silver_sandstone_brick.png"}, {"default_silver_sandstone_brick.png"},
S("Silver Sandstone Brick Stair"), "Silver Sandstone Brick Stair",
S("Silver Sandstone Brick Slab"), "Silver Sandstone Brick Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
false false
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"silver_sandstone_block", "silver_sandstone_block",
"default:silver_sandstone_block", "default:silver_sandstone_block",
{cracky = 2}, {cracky = 2},
{"default_silver_sandstone_block.png"}, {"default_silver_sandstone_block.png"},
S("Silver Sandstone Block Stair"), "Silver Sandstone Block Stair",
S("Silver Sandstone Block Slab"), "Silver Sandstone Block Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"obsidian", "obsidian",
"default:obsidian", "default:obsidian",
{cracky = 1, level = 2}, {cracky = 1, level = 2},
{"default_obsidian.png"}, {"default_obsidian.png"},
S("Obsidian Stair"), "Obsidian Stair",
S("Obsidian Slab"), "Obsidian Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"obsidianbrick", "obsidianbrick",
"default:obsidianbrick", "default:obsidianbrick",
{cracky = 1, level = 2}, {cracky = 1, level = 2},
{"default_obsidian_brick.png"}, {"default_obsidian_brick.png"},
S("Obsidian Brick Stair"), "Obsidian Brick Stair",
S("Obsidian Brick Slab"), "Obsidian Brick Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
false false
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"obsidian_block", "obsidian_block",
"default:obsidian_block", "default:obsidian_block",
{cracky = 1, level = 2}, {cracky = 1, level = 2},
{"default_obsidian_block.png"}, {"default_obsidian_block.png"},
S("Obsidian Block Stair"), "Obsidian Block Stair",
S("Obsidian Block Slab"), "Obsidian Block Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"brick", "brick",
"default:brick", "default:brick",
{cracky = 3}, {cracky = 3},
{"default_brick.png"}, {"default_brick.png"},
S("Brick Stair"), "Brick Stair",
S("Brick Slab"), "Brick Slab",
default.node_sound_stone_defaults(), default.node_sound_stone_defaults(),
false false
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"steelblock", "steelblock",
"default:steelblock", "default:steelblock",
{cracky = 1, level = 2}, {cracky = 1, level = 2},
{"default_steel_block.png"}, {"default_steel_block.png"},
S("Steel Block Stair"), "Steel Block Stair",
S("Steel Block Slab"), "Steel Block Slab",
default.node_sound_metal_defaults(), default.node_sound_metal_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"tinblock", "tinblock",
"default:tinblock", "default:tinblock",
{cracky = 1, level = 2}, {cracky = 1, level = 2},
{"default_tin_block.png"}, {"default_tin_block.png"},
S("Tin Block Stair"), "Tin Block Stair",
S("Tin Block Slab"), "Tin Block Slab",
default.node_sound_metal_defaults(), default.node_sound_metal_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"copperblock", "copperblock",
"default:copperblock", "default:copperblock",
{cracky = 1, level = 2}, {cracky = 1, level = 2},
{"default_copper_block.png"}, {"default_copper_block.png"},
S("Copper Block Stair"), "Copper Block Stair",
S("Copper Block Slab"), "Copper Block Slab",
default.node_sound_metal_defaults(), default.node_sound_metal_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"bronzeblock", "bronzeblock",
"default:bronzeblock", "default:bronzeblock",
{cracky = 1, level = 2}, {cracky = 1, level = 2},
{"default_bronze_block.png"}, {"default_bronze_block.png"},
S("Bronze Block Stair"), "Bronze Block Stair",
S("Bronze Block Slab"), "Bronze Block Slab",
default.node_sound_metal_defaults(), default.node_sound_metal_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"goldblock", "goldblock",
"default:goldblock", "default:goldblock",
{cracky = 1}, {cracky = 1},
{"default_gold_block.png"}, {"default_gold_block.png"},
S("Gold Block Stair"), "Gold Block Stair",
S("Gold Block Slab"), "Gold Block Slab",
default.node_sound_metal_defaults(), default.node_sound_metal_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"ice", "ice",
"default:ice", "default:ice",
{cracky = 3, cools_lava = 1, slippery = 3}, {cracky = 3, cools_lava = 1, slippery = 3},
{"default_ice.png"}, {"default_ice.png"},
S("Ice Stair"), "Ice Stair",
S("Ice Slab"), "Ice Slab",
default.node_sound_glass_defaults(), default.node_sound_glass_defaults(),
true true
) )
stairs.register_stair_and_slab( my_register_stair_and_slab(
"snowblock", "snowblock",
"default:snowblock", "default:snowblock",
{crumbly = 3, cools_lava = 1, snowy = 1}, {crumbly = 3, cools_lava = 1, snowy = 1},
{"default_snow.png"}, {"default_snow.png"},
S("Snow Block Stair"), "Snow Block Stair",
S("Snow Block Slab"), "Snow Block Slab",
default.node_sound_snow_defaults(), default.node_sound_snow_defaults(),
true true
) )
@ -877,9 +900,10 @@ stairs.register_stair_inner(
{"stairs_glass_stairside.png^[transformR270", "default_glass.png", {"stairs_glass_stairside.png^[transformR270", "default_glass.png",
"stairs_glass_stairside.png^[transformFX", "default_glass.png", "stairs_glass_stairside.png^[transformFX", "default_glass.png",
"default_glass.png", "stairs_glass_stairside.png"}, "default_glass.png", "stairs_glass_stairside.png"},
S("Glass Stair"), "",
default.node_sound_glass_defaults(), default.node_sound_glass_defaults(),
false false,
S("Inner Glass Stair")
) )
stairs.register_stair_outer( stairs.register_stair_outer(
@ -889,9 +913,10 @@ stairs.register_stair_outer(
{"stairs_glass_stairside.png^[transformR90", "default_glass.png", {"stairs_glass_stairside.png^[transformR90", "default_glass.png",
"stairs_glass_outer_stairside.png", "stairs_glass_stairside.png", "stairs_glass_outer_stairside.png", "stairs_glass_stairside.png",
"stairs_glass_stairside.png^[transformR90","stairs_glass_outer_stairside.png"}, "stairs_glass_stairside.png^[transformR90","stairs_glass_outer_stairside.png"},
S("Glass Stair"), "",
default.node_sound_glass_defaults(), default.node_sound_glass_defaults(),
false false,
S("Outer Glass Stair")
) )
stairs.register_stair( stairs.register_stair(
@ -923,9 +948,10 @@ stairs.register_stair_inner(
{"stairs_obsidian_glass_stairside.png^[transformR270", "default_obsidian_glass.png", {"stairs_obsidian_glass_stairside.png^[transformR270", "default_obsidian_glass.png",
"stairs_obsidian_glass_stairside.png^[transformFX", "default_obsidian_glass.png", "stairs_obsidian_glass_stairside.png^[transformFX", "default_obsidian_glass.png",
"default_obsidian_glass.png", "stairs_obsidian_glass_stairside.png"}, "default_obsidian_glass.png", "stairs_obsidian_glass_stairside.png"},
S("Obsidian Glass Stair"), "",
default.node_sound_glass_defaults(), default.node_sound_glass_defaults(),
false false,
S("Inner Obsidian Glass Stair")
) )
stairs.register_stair_outer( stairs.register_stair_outer(
@ -935,7 +961,152 @@ stairs.register_stair_outer(
{"stairs_obsidian_glass_stairside.png^[transformR90", "default_obsidian_glass.png", {"stairs_obsidian_glass_stairside.png^[transformR90", "default_obsidian_glass.png",
"stairs_obsidian_glass_outer_stairside.png", "stairs_obsidian_glass_stairside.png", "stairs_obsidian_glass_outer_stairside.png", "stairs_obsidian_glass_stairside.png",
"stairs_obsidian_glass_stairside.png^[transformR90","stairs_obsidian_glass_outer_stairside.png"}, "stairs_obsidian_glass_stairside.png^[transformR90","stairs_obsidian_glass_outer_stairside.png"},
S("Obsidian Glass Stair"), "",
default.node_sound_glass_defaults(), default.node_sound_glass_defaults(),
false false,
S("Outer Obsidian Glass Stair")
) )
-- Dummy calls to S() to allow translation scripts to detect the strings.
-- To update this add this code to my_register_stair_and_slab:
-- for _,x in ipairs({"","Inner ","Outer "}) do print(("S(%q)"):format(x..desc_stair)) end
-- print(("S(%q)"):format(desc_slab))
--[[
S("Wooden Stair")
S("Inner Wooden Stair")
S("Outer Wooden Stair")
S("Wooden Slab")
S("Jungle Wood Stair")
S("Inner Jungle Wood Stair")
S("Outer Jungle Wood Stair")
S("Jungle Wood Slab")
S("Pine Wood Stair")
S("Inner Pine Wood Stair")
S("Outer Pine Wood Stair")
S("Pine Wood Slab")
S("Acacia Wood Stair")
S("Inner Acacia Wood Stair")
S("Outer Acacia Wood Stair")
S("Acacia Wood Slab")
S("Aspen Wood Stair")
S("Inner Aspen Wood Stair")
S("Outer Aspen Wood Stair")
S("Aspen Wood Slab")
S("Stone Stair")
S("Inner Stone Stair")
S("Outer Stone Stair")
S("Stone Slab")
S("Cobblestone Stair")
S("Inner Cobblestone Stair")
S("Outer Cobblestone Stair")
S("Cobblestone Slab")
S("Mossy Cobblestone Stair")
S("Inner Mossy Cobblestone Stair")
S("Outer Mossy Cobblestone Stair")
S("Mossy Cobblestone Slab")
S("Stone Brick Stair")
S("Inner Stone Brick Stair")
S("Outer Stone Brick Stair")
S("Stone Brick Slab")
S("Stone Block Stair")
S("Inner Stone Block Stair")
S("Outer Stone Block Stair")
S("Stone Block Slab")
S("Desert Stone Stair")
S("Inner Desert Stone Stair")
S("Outer Desert Stone Stair")
S("Desert Stone Slab")
S("Desert Cobblestone Stair")
S("Inner Desert Cobblestone Stair")
S("Outer Desert Cobblestone Stair")
S("Desert Cobblestone Slab")
S("Desert Stone Brick Stair")
S("Inner Desert Stone Brick Stair")
S("Outer Desert Stone Brick Stair")
S("Desert Stone Brick Slab")
S("Desert Stone Block Stair")
S("Inner Desert Stone Block Stair")
S("Outer Desert Stone Block Stair")
S("Desert Stone Block Slab")
S("Sandstone Stair")
S("Inner Sandstone Stair")
S("Outer Sandstone Stair")
S("Sandstone Slab")
S("Sandstone Brick Stair")
S("Inner Sandstone Brick Stair")
S("Outer Sandstone Brick Stair")
S("Sandstone Brick Slab")
S("Sandstone Block Stair")
S("Inner Sandstone Block Stair")
S("Outer Sandstone Block Stair")
S("Sandstone Block Slab")
S("Desert Sandstone Stair")
S("Inner Desert Sandstone Stair")
S("Outer Desert Sandstone Stair")
S("Desert Sandstone Slab")
S("Desert Sandstone Brick Stair")
S("Inner Desert Sandstone Brick Stair")
S("Outer Desert Sandstone Brick Stair")
S("Desert Sandstone Brick Slab")
S("Desert Sandstone Block Stair")
S("Inner Desert Sandstone Block Stair")
S("Outer Desert Sandstone Block Stair")
S("Desert Sandstone Block Slab")
S("Silver Sandstone Stair")
S("Inner Silver Sandstone Stair")
S("Outer Silver Sandstone Stair")
S("Silver Sandstone Slab")
S("Silver Sandstone Brick Stair")
S("Inner Silver Sandstone Brick Stair")
S("Outer Silver Sandstone Brick Stair")
S("Silver Sandstone Brick Slab")
S("Silver Sandstone Block Stair")
S("Inner Silver Sandstone Block Stair")
S("Outer Silver Sandstone Block Stair")
S("Silver Sandstone Block Slab")
S("Obsidian Stair")
S("Inner Obsidian Stair")
S("Outer Obsidian Stair")
S("Obsidian Slab")
S("Obsidian Brick Stair")
S("Inner Obsidian Brick Stair")
S("Outer Obsidian Brick Stair")
S("Obsidian Brick Slab")
S("Obsidian Block Stair")
S("Inner Obsidian Block Stair")
S("Outer Obsidian Block Stair")
S("Obsidian Block Slab")
S("Brick Stair")
S("Inner Brick Stair")
S("Outer Brick Stair")
S("Brick Slab")
S("Steel Block Stair")
S("Inner Steel Block Stair")
S("Outer Steel Block Stair")
S("Steel Block Slab")
S("Tin Block Stair")
S("Inner Tin Block Stair")
S("Outer Tin Block Stair")
S("Tin Block Slab")
S("Copper Block Stair")
S("Inner Copper Block Stair")
S("Outer Copper Block Stair")
S("Copper Block Slab")
S("Bronze Block Stair")
S("Inner Bronze Block Stair")
S("Outer Bronze Block Stair")
S("Bronze Block Slab")
S("Gold Block Stair")
S("Inner Gold Block Stair")
S("Outer Gold Block Stair")
S("Gold Block Slab")
S("Ice Stair")
S("Inner Ice Stair")
S("Outer Ice Stair")
S("Ice Slab")
S("Snow Block Stair")
S("Inner Snow Block Stair")
S("Outer Snow Block Stair")
S("Snow Block Slab")
--]]

View File

@ -9,7 +9,7 @@ for i = 1, #dyes do
local name, desc = unpack(dyes[i]) local name, desc = unpack(dyes[i])
minetest.register_node("wool:" .. name, { minetest.register_node("wool:" .. name, {
description = S("@1 Wool", desc), description = S(desc .. " Wool"),
tiles = {"wool_" .. name .. ".png"}, tiles = {"wool_" .. name .. ".png"},
is_ground_content = false, is_ground_content = false,
groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3,
@ -28,3 +28,25 @@ end
-- Backwards compatibility with jordach's 16-color wool mod -- Backwards compatibility with jordach's 16-color wool mod
minetest.register_alias("wool:dark_blue", "wool:blue") minetest.register_alias("wool:dark_blue", "wool:blue")
minetest.register_alias("wool:gold", "wool:yellow") minetest.register_alias("wool:gold", "wool:yellow")
-- Dummy calls to S() to allow translation scripts to detect the strings.
-- To update this run:
-- for _,e in ipairs(dye.dyes) do print(("S(%q)"):format(e[2].." Wool")) end
--[[
S("White Wool")
S("Grey Wool")
S("Dark Grey Wool")
S("Black Wool")
S("Violet Wool")
S("Blue Wool")
S("Cyan Wool")
S("Dark Green Wool")
S("Green Wool")
S("Yellow Wool")
S("Brown Wool")
S("Orange Wool")
S("Red Wool")
S("Magenta Wool")
S("Pink Wool")
--]]