Make mcl_colorblocks translatable

This commit is contained in:
Wuzzy 2019-03-15 02:05:10 +01:00
parent 62e1186827
commit 93e34d1d03
1 changed files with 33 additions and 29 deletions

View File

@ -1,34 +1,35 @@
local init = os.clock() local init = os.clock()
local S = minetest.get_translator("mcl_colorblocks")
local block = {} local block = {}
block.dyes = { block.dyes = {
{"white", "White", "white"}, {"white", S("White Terracotta"), S("White Glazed Terracotta"), S("White Concrete Powder"), S("White Concrete"), "white"},
{"grey", "Grey", "dark_grey"}, {"grey", S("Grey Terracotta"), S("Grey Glazed Terracotta"), S("Grey Concrete Powder"), S("Grey Concrete"), "dark_grey"},
{"silver", "Light Grey", "grey"}, {"silver", S("Light Grey Terracotta"), S("Light Grey Glazed Terracotta"), S("Light Grey Concrete Powder"), S("Light Grey Concrete"), "grey"},
{"black", "Black", "black"}, {"black", S("Black Terracotta"), S("Black Glazed Terracotta"), S("Black Concrete Powder"), S("Black Concrete"), "black"},
{"red", "Red", "red"}, {"red", S("Red Terracotta"), S("Red Glazed Terracotta"), S("Red Concrete Powder"), S("Red Concrete"), "red"},
{"yellow", "Yellow", "yellow"}, {"yellow", S("Yellow Terracotta"), S("Yellow Glazed Terracotta"), S("Yellow Concrete Powder"), S("Yellow Concrete"), "yellow"},
{"green", "Green", "dark_green"}, {"green", S("Green Terracotta"), S("Green Glazed Terracotta"), S("Green Concrete Powder"), S("Green Concrete"), "dark_green"},
{"cyan", "Cyan", "cyan"}, {"cyan", S("Cyan Terracotta"), S("Cyan Glazed Terracotta"), S("Cyan Concrete Powder"), S("Cyan Concrete"), "cyan"},
{"blue", "Blue", "blue"}, {"blue", S("Blue Terracotta"), S("Blue Glazed Terracotta"), S("Blue Concrete Powder"), S("Blue Concrete"), "blue"},
{"magenta", "Magenta", "magenta"}, {"magenta", S("Magenta Terracotta"), S("Magenta Glazed Terracotta"), S("Magenta Concrete Powder"), S("Magenta Concrete"), "magenta"},
{"orange", "Orange", "orange"}, {"orange", S("Orange Terracotta"), S("Orange Glazed Terracotta"), S("Orange Concrete Powder"), S("Orange Concrete"), "orange"},
{"purple", "Purple", "violet"}, {"purple", S("Purple Terracotta"), S("Purple Glazed Terracotta"), S("Purple Concrete Powder"), S("Purple Concrete"), "violet"},
{"brown", "Brown", "brown"}, {"brown", S("Brown Terracotta"), S("Brown Glazed Terracotta"), S("Brown Concrete Powder"), S("Brown Concrete"), "brown"},
{"pink", "Pink", "pink"}, {"pink", S("Pink Terracotta"), S("Pink Glazed Terracotta"), S("Pink Concrete Powder"), S("Pink Concrete"), "pink"},
{"lime", "Lime", "green"}, {"lime", S("Lime Terracotta"), S("Lime Glazed Terracotta"), S("Lime Concrete Powder"), S("Lime Concrete"), "green"},
{"light_blue", "Light Blue", "lightblue"}, {"light_blue", S("Light Blue Terracotta"), S("Light Blue Glazed Terracotta"), S("Light Blue Concrete Powder"), S("Light Blue Concrete"), "lightblue"},
} }
local hc_desc = "Terracotta is a basic building material. It comes in many different colors." local hc_desc = S("Terracotta is a basic building material. It comes in many different colors.")
local gt_desc = "Glazed terracotta is a decorative block with a complex pattern. It can be rotated by placing it in different directions." local gt_desc = S("Glazed terracotta is a decorative block with a complex pattern. It can be rotated by placing it in different directions.")
local cp_desc = "Concrete powder is used for creating concrete, but it can also be used as decoration itself. It comes in different colors. Concrete powder turns into concrete of the same color when it comes in contact with water." local cp_desc = S("Concrete powder is used for creating concrete, but it can also be used as decoration itself. It comes in different colors. Concrete powder turns into concrete of the same color when it comes in contact with water.")
local conc_desc = "Concrete is a decorative block which comes in many different colors. It is notable for having a very strong and clean color.", local c_desc = S("Concrete is a decorative block which comes in many different colors. It is notable for having a very strong and clean color.")
minetest.register_node("mcl_colorblocks:hardened_clay", { minetest.register_node("mcl_colorblocks:hardened_clay", {
description = "Terracotta", description = S("Terracotta"),
_doc_items_longdesc = "Terracotta is a basic building material.", _doc_items_longdesc = S("Terracotta is a basic building material which comes in many different colors. This particular block is uncolored."),
tiles = {"hardened_clay.png"}, tiles = {"hardened_clay.png"},
stack_max = 64, stack_max = 64,
groups = {pickaxey=1, hardened_clay=1,building_block=1, material_stone=1}, groups = {pickaxey=1, hardened_clay=1,building_block=1, material_stone=1},
@ -51,11 +52,14 @@ end
for _, row in ipairs(block.dyes) do for _, row in ipairs(block.dyes) do
local name = row[1] local name = row[1]
local desc = row[2] local sdesc_hc = row[2]
local craft_color_group = row[3] local sdesc_gt = row[3]
local sdesc_cp = row[4]
local sdesc_c = row[5]
local craft_color_group = row[6]
-- Node Definition -- Node Definition
minetest.register_node("mcl_colorblocks:hardened_clay_"..name, { minetest.register_node("mcl_colorblocks:hardened_clay_"..name, {
description = desc.." Terracotta", description = sdesc_hc,
_doc_items_longdesc = hc_desc, _doc_items_longdesc = hc_desc,
tiles = {"hardened_clay_stained_"..name..".png"}, tiles = {"hardened_clay_stained_"..name..".png"},
groups = {pickaxey=1, hardened_clay=1,building_block=1, material_stone=1}, groups = {pickaxey=1, hardened_clay=1,building_block=1, material_stone=1},
@ -66,7 +70,7 @@ for _, row in ipairs(block.dyes) do
}) })
minetest.register_node("mcl_colorblocks:concrete_powder_"..name, { minetest.register_node("mcl_colorblocks:concrete_powder_"..name, {
description = desc.." Concrete Powder", description = sdesc_cp,
_doc_items_longdesc = cp_desc, _doc_items_longdesc = cp_desc,
tiles = {"mcl_colorblocks_concrete_powder_"..name..".png"}, tiles = {"mcl_colorblocks_concrete_powder_"..name..".png"},
groups = {handy=1,shovely=1, concrete_powder=1,building_block=1,falling_node=1, material_sand=1}, groups = {handy=1,shovely=1, concrete_powder=1,building_block=1,falling_node=1, material_sand=1},
@ -104,8 +108,8 @@ for _, row in ipairs(block.dyes) do
}) })
minetest.register_node("mcl_colorblocks:concrete_"..name, { minetest.register_node("mcl_colorblocks:concrete_"..name, {
description = desc.." Concrete", description = sdesc_c,
_doc_items_longdesc = conc_desc, _doc_items_longdesc = c_desc,
tiles = {"mcl_colorblocks_concrete_"..name..".png"}, tiles = {"mcl_colorblocks_concrete_"..name..".png"},
groups = {handy=1,pickaxey=1, concrete=1,building_block=1, material_stone=1}, groups = {handy=1,pickaxey=1, concrete=1,building_block=1, material_stone=1},
stack_max = 64, stack_max = 64,
@ -118,7 +122,7 @@ for _, row in ipairs(block.dyes) do
local tex = "mcl_colorblocks_glazed_terracotta_"..name..".png" local tex = "mcl_colorblocks_glazed_terracotta_"..name..".png"
local texes = { tex, tex, tex.."^[transformR180", tex, tex.."^[transformR270", tex.."^[transformR90" } local texes = { tex, tex, tex.."^[transformR180", tex, tex.."^[transformR270", tex.."^[transformR90" }
minetest.register_node("mcl_colorblocks:glazed_terracotta_"..name, { minetest.register_node("mcl_colorblocks:glazed_terracotta_"..name, {
description = desc.." Glazed Terracotta", description = sdesc_gt,
_doc_items_longdesc = gt_desc, _doc_items_longdesc = gt_desc,
tiles = texes, tiles = texes,
groups = {handy=1,pickaxey=1, glazed_terracotta=1,building_block=1, material_stone=1}, groups = {handy=1,pickaxey=1, glazed_terracotta=1,building_block=1, material_stone=1},