Fix translation of wrought iron blocks

Note: nodes to convert from steel blocks to wroughtiron blocks now
require to be added manually since doing this automatically breaks
translations.
This commit is contained in:
Louis 2020-02-18 14:32:36 +01:00
parent 8c7e636ceb
commit 026c1ae6fe
9 changed files with 78 additions and 41 deletions

View File

@ -47,6 +47,12 @@ Stainless Steel Block=Edelstahlblock
Brass Block=Messingblock
Wrought Iron=Schmiedeeisen
#### Steel to wrought iron
Outer Wrought Iron Block Stair=
Inner Wrought Iron Block Stair=
Wrought Iron Block Stair=
Wrought Iron Block Slab=
## rubber.lua
Rubber Tree Sapling=Gummibaumsetzling
Rubber Tree=Gummibaum

View File

@ -45,6 +45,12 @@ Stainless Steel Block=Bloque de Acero Inoxidable
Brass Block=Bloque de Latón
Wrought Iron=Hierro Forjado
#### Steel to wrought iron
Outer Wrought Iron Block Stair=
Inner Wrought Iron Block Stair=
Wrought Iron Block Stair=
Wrought Iron Block Slab=
###rubber.lua
Rubber Tree Sapling=Retoño de Árbol de Goma
Rubber Tree=Árbol de Goma

View File

@ -52,6 +52,12 @@ Stainless Steel Block=Bloc d'acier inoxydable
Brass Block=Bloc de laiton
Wrought Iron=Fer forgé
#### Steel to wrought iron
Outer Wrought Iron Block Stair=Escalier extérieur en bloc de fer forgé
Inner Wrought Iron Block Stair=Escalier intérieur en bloc de fer forgé
Wrought Iron Block Stair=Escalier en bloc de fer forgé
Wrought Iron Block Slab=Dalle en bloc de fer forgé
###rubber.lua
Rubber Tree Sapling=Pousse d'arbre à caoutchouc
Rubber Tree=Arbre à caoutchouc

View File

@ -47,6 +47,12 @@ Stainless Steel Block=Blok stali nierdzewnej
Brass Block=Blok mosiądzu
Wrought Iron=Kute żelazo
#### Steel to wrought iron
Outer Wrought Iron Block Stair=
Inner Wrought Iron Block Stair=
Wrought Iron Block Stair=
Wrought Iron Block Slab=
###rubber.lua
Rubber Tree Sapling=Sadzonka kauczukowca
Rubber Tree=Kauczukowiec

View File

@ -47,6 +47,12 @@ Stainless Steel Block=Bloco de Aço Inoxidável
Brass Block=Bloco de Latão
Wrought Iron=Ferro Forjado
#### Steel to wrought iron
Outer Wrought Iron Block Stair=
Inner Wrought Iron Block Stair=
Wrought Iron Block Stair=
Wrought Iron Block Slab=
###rubber.lua
Rubber Tree Sapling=Muda de Árvore de Borracha
Rubber Tree=Árvore de Borracha

View File

@ -47,6 +47,12 @@ Stainless Steel Block=Paslanmaz çelik blok
Brass Block=Pirinç blok
Wrought Iron=İşlenmiş demir
#### Steel to wrought iron
Outer Wrought Iron Block Stair=
Inner Wrought Iron Block Stair=
Wrought Iron Block Stair=
Wrought Iron Block Slab=
###rubber.lua
Rubber Tree Sapling=Kauçuk ağacı fidanı
Rubber Tree=Kauçuk ağacı

View File

@ -53,6 +53,12 @@ Stainless Steel Block=
Brass Block=
Wrought Iron=
#### Steel to wrought iron
Outer Wrought Iron Block Stair=
Inner Wrought Iron Block Stair=
Wrought Iron Block Stair=
Wrought Iron Block Slab=
###rubber.lua
Rubber Tree Sapling=
Rubber Tree=

View File

@ -1,3 +1,3 @@
name = technic_worldgen
depends = default, basic_materials
optional_depends = mg, doors, farming, glooptest, mesecons_doors, vessels, toolranks
optional_depends = mg, doors, farming, glooptest, mesecons_doors, vessels, toolranks, stairs

View File

@ -144,47 +144,42 @@ minetest.register_craft({
minetest.register_alias("technic:diamond_block", "default:diamondblock")
minetest.register_alias("technic:diamond", "default:diamond")
minetest.register_alias("technic:mineral_diamond", "default:stone_with_diamond")
local steel_to_wrought_iron = {
{name="stairs:stair_outer_steelblock", description=S("Outer Wrought Iron Block Stair")},
{name="stairs:stair_inner_steelblock", description=S("Inner Wrought Iron Block Stair")},
{name="stairs:stair_steelblock", description=S("Wrought Iron Block Stair")},
{name="stairs:slab_steelblock", description=S("Wrought Iron Block Slab")}
}
local function for_each_registered_node(action)
local really_register_node = minetest.register_node
minetest.register_node = function(name, def)
really_register_node(name, def)
action(name:gsub("^:", ""), def)
end
for name, def in pairs(minetest.registered_nodes) do
action(name, def)
for _, v in ipairs(steel_to_wrought_iron) do
local node_name = v.name
local node_def = minetest.registered_items[node_name]
if node_def then
minetest.override_item(node_name, {
description = v.description
})
local tiles = node_def.tiles or node_def.tile_images
if tiles then
local new_tiles = {}
local do_override = false
if type(tiles) == "string" then
tiles = {tiles}
end
for i, t in ipairs(tiles) do
if type(t) == "string" and t == "default_steel_block.png" then
do_override = true
t = "technic_wrought_iron_block.png"
end
table.insert(new_tiles, t)
end
if do_override then
minetest.override_item(node_name, {
tiles = new_tiles
})
end
end
end
end
for_each_registered_node(function(node_name, node_def)
if node_name ~= "default:steelblock" and
node_name:find("steelblock", 1, true) and
node_def.description:find("Steel", 1, true) then
minetest.override_item(node_name, {
-- TODO: fix this line
-- This is not the good way of doing this because this breaks translations
description = node_def.description:gsub("Steel", "Wrought Iron"),
})
end
local tiles = node_def.tiles or node_def.tile_images
if tiles then
local new_tiles = {}
local do_override = false
if type(tiles) == "string" then
tiles = {tiles}
end
for i, t in ipairs(tiles) do
if type(t) == "string" and t == "default_steel_block.png" then
do_override = true
t = "technic_wrought_iron_block.png"
end
table.insert(new_tiles, t)
end
if do_override then
minetest.override_item(node_name, {
tiles = new_tiles
})
end
end
end)