From 1cd496292d2ac4d6ceab8d738aeef3196a8da9ff Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 23 Feb 2020 19:59:17 +0100 Subject: [PATCH] Add MT 5.0 translation support --- mesecons_blinkyplant/init.lua | 4 +- mesecons_button/init.lua | 6 +- mesecons_commandblock/init.lua | 54 ++++++++++-------- mesecons_delayer/init.lua | 5 +- mesecons_detector/init.lua | 21 ++++--- mesecons_extrawires/corner.lua | 3 +- mesecons_extrawires/crossover.lua | 7 +-- mesecons_extrawires/tjunction.lua | 4 +- mesecons_extrawires/vertical.lua | 8 ++- mesecons_fpga/init.lua | 39 +++++++------ mesecons_fpga/logic.lua | 17 +++--- mesecons_fpga/tool.lua | 12 ++-- mesecons_gates/init.lua | 21 ++++--- mesecons_hydroturbine/init.lua | 6 +- mesecons_insulated/init.lua | 6 +- mesecons_lamp/init.lua | 4 +- mesecons_lightstone/init.lua | 28 ++++----- mesecons_luacontroller/init.lua | 22 ++++--- .../textures/jeija_luac_background.png | Bin 655 -> 520 bytes .../textures/jeija_luac_runbutton.png | Bin 2150 -> 0 bytes mesecons_materials/init.lua | 8 ++- mesecons_microcontroller/init.lua | 51 +++++++++-------- mesecons_movestones/init.lua | 10 ++-- mesecons_noteblock/init.lua | 4 +- mesecons_pistons/init.lua | 14 +++-- mesecons_powerplant/init.lua | 4 +- mesecons_pressureplates/init.lua | 6 +- mesecons_random/init.lua | 6 +- mesecons_solarpanel/init.lua | 4 +- mesecons_stickyblocks/init.lua | 4 +- mesecons_switch/init.lua | 4 +- mesecons_torch/init.lua | 4 +- mesecons_walllever/init.lua | 4 +- mesecons_wires/init.lua | 4 +- 34 files changed, 231 insertions(+), 163 deletions(-) delete mode 100644 mesecons_luacontroller/textures/jeija_luac_runbutton.png diff --git a/mesecons_blinkyplant/init.lua b/mesecons_blinkyplant/init.lua index 14a274f..867aa9b 100644 --- a/mesecons_blinkyplant/init.lua +++ b/mesecons_blinkyplant/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_blinkyplant") + -- The BLINKY_PLANT local toggle_timer = function (pos) @@ -20,7 +22,7 @@ local on_timer = function (pos) end mesecon.register_node("mesecons_blinkyplant:blinky_plant", { - description="Blinky Plant", + description=S("Blinky Plant"), drawtype = "plantlike", inventory_image = "jeija_blinky_plant_off.png", paramtype = "light", diff --git a/mesecons_button/init.lua b/mesecons_button/init.lua index 8764fbc..65286c2 100644 --- a/mesecons_button/init.lua +++ b/mesecons_button/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_button") + -- WALL BUTTON -- A button that when pressed emits power for 1 second -- and then turns off again @@ -42,7 +44,7 @@ minetest.register_node("mesecons_button:button_off", { } }, groups = {dig_immediate=2, mesecon_needs_receiver = 1}, - description = "Button", + description = S("Button"), on_rightclick = function (pos, node) minetest.swap_node(pos, {name = "mesecons_button:button_on", param2=node.param2}) mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node)) @@ -88,7 +90,7 @@ minetest.register_node("mesecons_button:button_on", { }, groups = {dig_immediate=2, not_in_creative_inventory=1, mesecon_needs_receiver = 1}, drop = 'mesecons_button:button_off', - description = "Button", + description = S("Button"), sounds = default.node_sound_stone_defaults(), mesecons = {receptor = { state = mesecon.state.on, diff --git a/mesecons_commandblock/init.lua b/mesecons_commandblock/init.lua index 326b8ae..4873e13 100644 --- a/mesecons_commandblock/init.lua +++ b/mesecons_commandblock/init.lua @@ -1,6 +1,9 @@ +local S = minetest.get_translator("mesecons_commandblock") +local F = minetest.formspec_escape + minetest.register_chatcommand("say", { - params = "", - description = "Say as the server", + params = S(""), + description = S("Say as the server"), privs = {server=true}, func = function(name, param) minetest.chat_send_all(name .. ": " .. param) @@ -8,36 +11,36 @@ minetest.register_chatcommand("say", { }) minetest.register_chatcommand("tell", { - params = " ", - description = "Say to privately", + params = S(" "), + description = S("Say to privately"), func = function(name, param) local found, _, target, message = param:find("^([^%s]+)%s+(.*)$") if found == nil then - minetest.chat_send_player(name, "Invalid usage: " .. param) + minetest.chat_send_player(name, S("Invalid usage: @1", param)) return end if not minetest.get_player_by_name(target) then - minetest.chat_send_player(name, "Invalid target: " .. target) + minetest.chat_send_player(name, S("Invalid target: @1", target)) end - minetest.chat_send_player(target, name .. " whispers: " .. message, false) + minetest.chat_send_player(target, S("@1 whispers: @2", name, message), false) end }) minetest.register_chatcommand("hp", { - params = " ", - description = "Set health of to hitpoints", + params = S(" "), + description = S("Set health of to hitpoints"), privs = {ban=true}, func = function(name, param) local found, _, target, value = param:find("^([^%s]+)%s+(%d+)$") if found == nil then - minetest.chat_send_player(name, "Invalid usage: " .. param) + minetest.chat_send_player(name, S("Invalid usage: @1", param)) return end local player = minetest.get_player_by_name(target) if player then player:set_hp(value) else - minetest.chat_send_player(name, "Invalid target: " .. target) + minetest.chat_send_player(name, S("Invalid target: @1", target)) end end }) @@ -46,18 +49,19 @@ local function initialize_data(meta) local commands = minetest.formspec_escape(meta:get_string("commands")) meta:set_string("formspec", "invsize[9,5;]" .. - "textarea[0.5,0.5;8.5,4;commands;Commands;"..commands.."]" .. - "label[1,3.8;@nearest, @farthest, and @random are replaced by the respective player names]" .. - "button_exit[3.3,4.5;2,1;submit;Submit]") + "textarea[0.5,0.5;8.5,4;commands;"..F(S("Commands"))..";"..commands.."]" .. + "label[1,3.8;"..F(S("@@nearest, @@farthest, and @@random are replaced by the respective player names.")).."]" .. + "button_exit[3.3,4.5;2,1;submit;"..F(S("Submit")).."]") local owner = meta:get_string("owner") + local ownstr = "" if owner == "" then - owner = "not owned" + ownstr = S("(not owned)") else - owner = "owned by " .. owner + ownstr = S("(owned by @1)", owner) end - meta:set_string("infotext", "Command Block\n" .. - "(" .. owner .. ")\n" .. - "Commands: "..commands) + meta:set_string("infotext", S("Command Block").."\n" .. + ownstr .. "\n" .. + S("Commands: @1", commands)) end local function construct(pos) @@ -150,15 +154,15 @@ local function commandblock_action_on(pos, node) end local cmddef = minetest.chatcommands[cmd] if not cmddef then - minetest.chat_send_player(owner, "The command "..cmd.." does not exist") + minetest.chat_send_player(owner, S("The command @1 does not exist", cmd)) return end local has_privs, missing_privs = minetest.check_player_privs(owner, cmddef.privs) if not has_privs then - minetest.chat_send_player(owner, "You don't have permission " - .."to run "..cmd - .." (missing privileges: " - ..table.concat(missing_privs, ", ")..")") + minetest.chat_send_player(owner, + S("You don't have permission to run @1 (missing privileges: @2)", + cmd, + table.concat(missing_privs, ", "))) return end cmddef.func(owner, param) @@ -178,7 +182,7 @@ local function can_dig(pos, player) end minetest.register_node("mesecons_commandblock:commandblock_off", { - description = "Command Block", + description = S("Command Block"), tiles = {"jeija_commandblock_off.png"}, inventory_image = minetest.inventorycube("jeija_commandblock_off.png"), is_ground_content = false, diff --git a/mesecons_delayer/init.lua b/mesecons_delayer/init.lua index 66665ad..3aa6534 100644 --- a/mesecons_delayer/init.lua +++ b/mesecons_delayer/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_delayer") + -- Function that get the input/output rules of the delayer local delayer_get_output_rules = function(node) local rules = {{x = 0, y = 0, z = 1}} @@ -80,7 +82,7 @@ if i > 1 then end local off_state = { - description = "Delayer", + description = S("Delayer"), tiles = { "mesecons_delayer_off_"..tostring(i)..".png", "mesecons_delayer_bottom.png", @@ -123,7 +125,6 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), off_state) -- Activated delayer definition defaults local on_state = { - description = "You hacker you", tiles = { "mesecons_delayer_on_"..tostring(i)..".png", "mesecons_delayer_bottom.png", diff --git a/mesecons_detector/init.lua b/mesecons_detector/init.lua index cdc7f92..1be464e 100644 --- a/mesecons_detector/init.lua +++ b/mesecons_detector/init.lua @@ -1,3 +1,6 @@ +local S = minetest.get_translator("mesecons_detector") +local F = minetest.formspec_escape + local GET_COMMAND = "GET" -- Object detector @@ -7,9 +10,9 @@ local GET_COMMAND = "GET" local function object_detector_make_formspec(pos) local meta = minetest.get_meta(pos) meta:set_string("formspec", "size[9,2.5]" .. - "field[0.3, 0;9,2;scanname;Name of player to scan for (empty for any):;${scanname}]".. - "field[0.3,1.5;4,2;digiline_channel;Digiline Channel (optional):;${digiline_channel}]".. - "button_exit[7,0.75;2,3;;Save]") + "field[0.3, 0;9,2;scanname;"..F(S("Name of player to scan for (empty for any):"))..";${scanname}]".. + "field[0.3,1.5;4,2;digiline_channel;"..F(S("Digiline Channel (optional):"))..";${digiline_channel}]".. + "button_exit[7,0.75;2,3;;"..F(S("Save")).."]") end local function object_detector_on_receive_fields(pos, formname, fields, sender) @@ -69,7 +72,7 @@ minetest.register_node("mesecons_detector:object_detector_off", { is_ground_content = false, walkable = true, groups = {cracky=3}, - description="Player Detector", + description=S("Player Detector"), mesecons = {receptor = { state = mesecon.state.off, rules = mesecon.rules.pplate @@ -150,10 +153,10 @@ local function node_detector_make_formspec(pos) local meta = minetest.get_meta(pos) if meta:get_string("distance") == "" then meta:set_string("distance", "0") end meta:set_string("formspec", "size[9,2.5]" .. - "field[0.3, 0;9,2;scanname;Name of node to scan for (empty for any):;${scanname}]".. - "field[0.3,1.5;2.5,2;distance;Distance (0-"..mesecon.setting("node_detector_distance_max", 10).."):;${distance}]".. - "field[3,1.5;4,2;digiline_channel;Digiline Channel (optional):;${digiline_channel}]".. - "button_exit[7,0.75;2,3;;Save]") + "field[0.3, 0;9,2;scanname;"..F(S("Name of node to scan for (empty for any):"))..";${scanname}]".. + "field[0.3,1.5;2.5,2;distance;"..F(S("Distance (0-@1):", mesecon.setting("node_detector_distance_max", 10)))..";${distance}]".. + "field[3,1.5;4,2;digiline_channel;"..F(S("Digiline Channel (optional):"))..";${digiline_channel}]".. + "button_exit[7,0.75;2,3;;"..F(S("Save")).."]") end local function node_detector_on_receive_fields(pos, fieldname, fields, sender) @@ -262,7 +265,7 @@ minetest.register_node("mesecons_detector:node_detector_off", { is_ground_content = false, walkable = true, groups = {cracky=3}, - description="Node Detector", + description=S("Node Detector"), mesecons = {receptor = { state = mesecon.state.off }}, diff --git a/mesecons_extrawires/corner.lua b/mesecons_extrawires/corner.lua index d33447a..a8b2a99 100644 --- a/mesecons_extrawires/corner.lua +++ b/mesecons_extrawires/corner.lua @@ -1,3 +1,4 @@ +local S = minetest.get_translator("mesecons_extrawires") local screwdriver_exists = minetest.global_exists("screwdriver") local corner_nodebox = { @@ -56,7 +57,7 @@ minetest.register_node("mesecons_extrawires:corner_on", { minetest.register_node("mesecons_extrawires:corner_off", { drawtype = "nodebox", - description = "Insulated Mesecon Corner", + description = S("Insulated Mesecon Corner"), tiles = { "jeija_insulated_wire_curved_tb_off.png", "jeija_insulated_wire_curved_tb_off.png^[transformR270", diff --git a/mesecons_extrawires/crossover.lua b/mesecons_extrawires/crossover.lua index 2656d61..a6bd549 100644 --- a/mesecons_extrawires/crossover.lua +++ b/mesecons_extrawires/crossover.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_extrawires") + local function crossover_get_rules(node) return { {--first wire @@ -19,7 +21,7 @@ local crossover_states = { } minetest.register_node("mesecons_extrawires:crossover_off", { - description = "Insulated Mesecon Crossover", + description = S("Insulated Mesecon Crossover"), drawtype = "mesh", mesh = "mesecons_extrawires_crossover.b3d", tiles = { @@ -45,7 +47,6 @@ minetest.register_node("mesecons_extrawires:crossover_off", { }) minetest.register_node("mesecons_extrawires:crossover_01", { - description = "You hacker you!", drop = "mesecons_extrawires:crossover_off", drawtype = "mesh", mesh = "mesecons_extrawires_crossover.b3d", @@ -72,7 +73,6 @@ minetest.register_node("mesecons_extrawires:crossover_01", { }) minetest.register_node("mesecons_extrawires:crossover_10", { - description = "You hacker you!", drop = "mesecons_extrawires:crossover_off", drawtype = "mesh", mesh = "mesecons_extrawires_crossover.b3d", @@ -99,7 +99,6 @@ minetest.register_node("mesecons_extrawires:crossover_10", { }) minetest.register_node("mesecons_extrawires:crossover_on", { - description = "You hacker you!", drop = "mesecons_extrawires:crossover_off", drawtype = "mesh", mesh = "mesecons_extrawires_crossover.b3d", diff --git a/mesecons_extrawires/tjunction.lua b/mesecons_extrawires/tjunction.lua index 77c4290..418ce44 100644 --- a/mesecons_extrawires/tjunction.lua +++ b/mesecons_extrawires/tjunction.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_extrawires") + local screwdriver_exists = minetest.global_exists("screwdriver") local tjunction_nodebox = { @@ -57,7 +59,7 @@ minetest.register_node("mesecons_extrawires:tjunction_on", { minetest.register_node("mesecons_extrawires:tjunction_off", { drawtype = "nodebox", - description = "Insulated Mesecon T-junction", + description = S("Insulated Mesecon T-junction"), tiles = { "jeija_insulated_wire_tjunction_tb_off.png", "jeija_insulated_wire_tjunction_tb_off.png^[transformR180", diff --git a/mesecons_extrawires/vertical.lua b/mesecons_extrawires/vertical.lua index 1543194..7f70f0e 100644 --- a/mesecons_extrawires/vertical.lua +++ b/mesecons_extrawires/vertical.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_extrawires") + local vertical_box = { type = "fixed", fixed = {-1/16, -8/16, -1/16, 1/16, 8/16, 1/16} @@ -77,7 +79,7 @@ end -- Vertical wire mesecon.register_node("mesecons_extrawires:vertical", { - description = "Vertical Mesecon", + description = S("Vertical Mesecon"), drawtype = "nodebox", walkable = false, paramtype = "light", @@ -110,7 +112,7 @@ mesecon.register_node("mesecons_extrawires:vertical", { -- Vertical wire top mesecon.register_node("mesecons_extrawires:vertical_top", { - description = "Vertical mesecon", + description = S("Vertical Mesecon"), drawtype = "nodebox", walkable = false, paramtype = "light", @@ -142,7 +144,7 @@ mesecon.register_node("mesecons_extrawires:vertical_top", { -- Vertical wire bottom mesecon.register_node("mesecons_extrawires:vertical_bottom", { - description = "Vertical mesecon", + description = S("Vertical Mesecon"), drawtype = "nodebox", walkable = false, paramtype = "light", diff --git a/mesecons_fpga/init.lua b/mesecons_fpga/init.lua index 6ba8f80..fbd4a74 100644 --- a/mesecons_fpga/init.lua +++ b/mesecons_fpga/init.lua @@ -1,3 +1,6 @@ +local S = minetest.get_translator("mesecons_fpga") +local F = minetest.formspec_escape + local plg = {} plg.rules = {} -- per-player formspec positions @@ -59,7 +62,7 @@ plg.register_nodes = function(template) end plg.register_nodes({ - description = "FPGA", + description = S("FPGA"), drawtype = "nodebox", tiles = { "", -- replaced later @@ -94,7 +97,7 @@ plg.register_nodes({ meta:set_string("instr", lcore.serialize(is)) meta:set_int("valid", 0) - meta:set_string("infotext", "FPGA") + meta:set_string("infotext", S("FPGA")) end, on_rightclick = function(pos, node, clicker) if not minetest.is_player(clicker) then @@ -138,13 +141,13 @@ plg.register_nodes({ dir = 1 if user and user:is_player() then minetest.chat_send_player(user:get_player_name(), - "FPGA ports have been rotated clockwise.") + S("FPGA ports have been rotated clockwise.")) end elseif mode == screwdriver.ROTATE_AXIS then -- counter-clockwise dir = -1 if user and user:is_player() then minetest.chat_send_player(user:get_player_name(), - "FPGA ports have been rotated counter-clockwise.") + S("FPGA ports have been rotated counter-clockwise.")) end end @@ -202,17 +205,17 @@ plg.to_formspec_string = function(is, err) x, y, name, table.concat(titles, ","), selected) end local s = "size[9,9]".. - "label[3.4,-0.15;FPGA gate configuration]".. - "button[7,7.5;2,2.5;program;Program]".. + "label[3.4,-0.15;"..F(S("FPGA gate configuration")).."]".. + "button[7,7.5;2,2.5;program;"..F(S("Program")).."]".. "box[4.2,0.5;0.03,7;#ffffff]".. - "label[0.25,0.25;op. 1]".. - "label[1.0,0.25;gate type]".. - "label[2.125,0.25;op. 2]".. - "label[3.15,0.25;dest]".. - "label[4.5,0.25;op. 1]".. - "label[5.25,0.25;gate type]".. - "label[6.375,0.25;op. 2]".. - "label[7.4,0.25;dest]" + "label[0.25,0.25;"..F(S("op. 1")).."]".. + "label[1.0,0.25;"..F(S("gate type")).."]".. + "label[2.125,0.25;"..F(S("op. 2")).."]".. + "label[3.15,0.25;"..F(S("dest")).."]".. + "label[4.5,0.25;"..F(S("op. 1")).."]".. + "label[5.25,0.25;"..F(S("gate type")).."]".. + "label[6.375,0.25;"..F(S("op. 2")).."]".. + "label[7.4,0.25;"..F(S("dest")).."]" local x = 1 - 0.75 local y = 1 - 0.25 for i = 1, 14 do @@ -232,7 +235,7 @@ plg.to_formspec_string = function(is, err) if err then local fmsg = minetest.colorize("#ff0000", minetest.formspec_escape(err.msg)) s = s .. plg.red_box_around(err.i) .. - "label[0.25,8.25;The gate configuration is erroneous in the marked area:]".. + "label[0.25,8.25;"..F(S("The gate configuration is erroneous in the marked area:")).."]".. "label[0.25,8.5;" .. fmsg .. "]" end return s @@ -276,10 +279,10 @@ plg.update_meta = function(pos, is) local err = lcore.validate(is) if err == nil then meta:set_int("valid", 1) - meta:set_string("infotext", "FPGA (functional)") + meta:set_string("infotext", S("FPGA (functional)")) else meta:set_int("valid", 0) - meta:set_string("infotext", "FPGA") + meta:set_string("infotext", S("FPGA")) end -- reset ports and run programmed logic @@ -316,7 +319,7 @@ plg.update = function(pos) elseif mesecon.do_overheat(pos) then plg.setports(pos, false, false, false, false) meta:set_int("valid", 0) - meta:set_string("infotext", "FPGA (overheated)") + meta:set_string("infotext", S("FPGA (overheated)")) return end diff --git a/mesecons_fpga/logic.lua b/mesecons_fpga/logic.lua index 106f779..f4c3ff2 100644 --- a/mesecons_fpga/logic.lua +++ b/mesecons_fpga/logic.lua @@ -1,3 +1,4 @@ +local S = minetest.get_translator("mesecons_fpga") local lg = {} @@ -132,34 +133,34 @@ lg.validate_single = function(t, i) -- check for completeness if not gate_data then - return {i = i, msg = "Gate type is required"} + return {i = i, msg = S("Gate type is required")} elseif gate_data.unary then if elem.op1 ~= nil or elem.op2 == nil or elem.dst == nil then - return {i = i, msg = "Second operand (only) and destination are required"} + return {i = i, msg = S("Second operand (only) and destination are required")} end else if elem.op1 == nil or elem.op2 == nil or elem.dst == nil then - return {i = i, msg = "Operands and destination are required"} + return {i = i, msg = S("Operands and destination are required")} end end -- check whether operands/destination are identical if compare_op(elem.op1, elem.op2) then - return {i = i, msg = "Operands cannot be identical"} + return {i = i, msg = S("Operands cannot be identical")} end if compare_op(elem.op1, elem.dst, true) or compare_op(elem.op2, elem.dst, true) then - return {i = i, msg = "Destination and operands must be different"} + return {i = i, msg = S("Destination and operands must be different")} end -- check whether operands point to defined registers if elem.op1 ~= nil and elem.op1.type == "reg" and not is_reg_written_to(t, elem.op1.n, i) then - return {i = i, msg = "First operand is undefined register"} + return {i = i, msg = S("First operand is undefined register")} end if elem.op2.type == "reg" and not is_reg_written_to(t, elem.op2.n, i) then - return {i = i, msg = "Second operand is undefined register"} + return {i = i, msg = S("Second operand is undefined register")} end -- check whether destination points to undefined register if elem.dst.type == "reg" and is_reg_written_to(t, elem.dst.n, i) then - return {i = i, msg = "Destination is already used register"} + return {i = i, msg = S("Destination is already used register")} end return nil diff --git a/mesecons_fpga/tool.lua b/mesecons_fpga/tool.lua index 22bfaea..ab90fe3 100644 --- a/mesecons_fpga/tool.lua +++ b/mesecons_fpga/tool.lua @@ -1,8 +1,10 @@ +local S = minetest.get_translator("mesecons_fpga") + return function(plg) minetest.register_tool("mesecons_fpga:programmer", { - description = "FPGA Programmer", + description = S("FPGA Programmer"), inventory_image = "jeija_fpga_programmer.png", stack_max = 1, on_place = function(itemstack, placer, pointed_thing) @@ -17,11 +19,11 @@ minetest.register_tool("mesecons_fpga:programmer", { local meta = minetest.get_meta(pos) if meta:get_string("instr") == "//////////////" then - minetest.chat_send_player(placer:get_player_name(), "This FPGA is unprogrammed.") + minetest.chat_send_player(placer:get_player_name(), S("This FPGA is unprogrammed.")) return itemstack end itemstack:set_metadata(meta:get_string("instr")) - minetest.chat_send_player(placer:get_player_name(), "FPGA gate configuration was successfully copied!") + minetest.chat_send_player(placer:get_player_name(), S("FPGA gate configuration was successfully copied!")) return itemstack end, @@ -42,14 +44,14 @@ minetest.register_tool("mesecons_fpga:programmer", { local imeta = itemstack:get_metadata() if imeta == "" then - minetest.chat_send_player(player_name, "Use shift+right-click to copy a gate configuration first.") + minetest.chat_send_player(player_name, S("Use shift+right-click to copy a gate configuration first.")) return itemstack end local meta = minetest.get_meta(pos) meta:set_string("instr", imeta) plg.update_meta(pos, imeta) - minetest.chat_send_player(player_name, "Gate configuration was successfully written to FPGA!") + minetest.chat_send_player(player_name, S("Gate configuration was successfully written to FPGA!")) return itemstack end diff --git a/mesecons_gates/init.lua b/mesecons_gates/init.lua index 421a7d4..23900a5 100644 --- a/mesecons_gates/init.lua +++ b/mesecons_gates/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_gates") + local nodebox = { type = "fixed", fixed = {{-8/16, -8/16, -8/16, 8/16, -7/16, 8/16 }}, @@ -57,7 +59,10 @@ end local function register_gate(name, inputnumber, assess, recipe, description) local get_inputrules = inputnumber == 2 and gate_get_input_rules_twoinputs or gate_get_input_rules_oneinput - description = "Logic Gate: "..name + + if not description then + description = S("Logic Gate: @1", name) + end local basename = "mesecons_gates:"..name mesecon.register_node(basename, { @@ -106,38 +111,38 @@ end register_gate("diode", 1, function (input) return input end, {{"mesecons:mesecon", "mesecons_torch:mesecon_torch_on", "mesecons_torch:mesecon_torch_on"}}, - "Diode") + S("Diode")) register_gate("not", 1, function (input) return not input end, {{"mesecons:mesecon", "mesecons_torch:mesecon_torch_on", "mesecons:mesecon"}}, - "NOT Gate") + S("NOT Gate")) register_gate("and", 2, function (val1, val2) return val1 and val2 end, {{"mesecons:mesecon", "", ""}, {"", "mesecons_materials:silicon", "mesecons:mesecon"}, {"mesecons:mesecon", "", ""}}, - "AND Gate") + S("AND Gate")) register_gate("nand", 2, function (val1, val2) return not (val1 and val2) end, {{"mesecons:mesecon", "", ""}, {"", "mesecons_materials:silicon", "mesecons_torch:mesecon_torch_on"}, {"mesecons:mesecon", "", ""}}, - "NAND Gate") + S("NAND Gate")) register_gate("xor", 2, function (val1, val2) return (val1 or val2) and not (val1 and val2) end, {{"mesecons:mesecon", "", ""}, {"", "mesecons_materials:silicon", "mesecons_materials:silicon"}, {"mesecons:mesecon", "", ""}}, - "XOR Gate") + S("XOR Gate")) register_gate("nor", 2, function (val1, val2) return not (val1 or val2) end, {{"mesecons:mesecon", "", ""}, {"", "mesecons:mesecon", "mesecons_torch:mesecon_torch_on"}, {"mesecons:mesecon", "", ""}}, - "NOR Gate") + S("NOR Gate")) register_gate("or", 2, function (val1, val2) return (val1 or val2) end, {{"mesecons:mesecon", "", ""}, {"", "mesecons:mesecon", "mesecons:mesecon"}, {"mesecons:mesecon", "", ""}}, - "OR Gate") + S("OR Gate")) diff --git a/mesecons_hydroturbine/init.lua b/mesecons_hydroturbine/init.lua index afa21e9..7d1190f 100644 --- a/mesecons_hydroturbine/init.lua +++ b/mesecons_hydroturbine/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_hydroturbine") + -- HYDRO_TURBINE -- Water turbine: -- Active if flowing >water< above it @@ -16,7 +18,7 @@ minetest.register_node("mesecons_hydroturbine:hydro_turbine_off", { is_ground_content = false, wield_scale = {x=0.75, y=0.75, z=0.75}, groups = {dig_immediate=2}, - description="Water Turbine", + description=S("Water Turbine"), paramtype = "light", selection_box = { type = "fixed", @@ -45,7 +47,7 @@ minetest.register_node("mesecons_hydroturbine:hydro_turbine_on", { inventory_image = "jeija_hydro_turbine_inv.png", drop = "mesecons_hydroturbine:hydro_turbine_off 1", groups = {dig_immediate=2,not_in_creative_inventory=1}, - description="Water Turbine", + description=S("Water Turbine"), paramtype = "light", selection_box = { type = "fixed", diff --git a/mesecons_insulated/init.lua b/mesecons_insulated/init.lua index ca55b9a..49bb34e 100644 --- a/mesecons_insulated/init.lua +++ b/mesecons_insulated/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_hydroturbine") + local screwdriver_exists = minetest.global_exists("screwdriver") local function insulated_wire_get_rules(node) @@ -11,7 +13,7 @@ end minetest.register_node("mesecons_insulated:insulated_on", { drawtype = "nodebox", - description = "Straight Insulated Mesecon", + description = S("Straight Insulated Mesecon"), tiles = { "jeija_insulated_wire_sides_on.png", "jeija_insulated_wire_sides_on.png", @@ -48,7 +50,7 @@ minetest.register_node("mesecons_insulated:insulated_on", { minetest.register_node("mesecons_insulated:insulated_off", { drawtype = "nodebox", - description = "Straight Insulated Mesecon", + description = S("Straight Insulated Mesecon"), tiles = { "jeija_insulated_wire_sides_off.png", "jeija_insulated_wire_sides_off.png", diff --git a/mesecons_lamp/init.lua b/mesecons_lamp/init.lua index 14a3659..37d2318 100644 --- a/mesecons_lamp/init.lua +++ b/mesecons_lamp/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_lamp") + -- MESELAMPS -- A lamp is "is an electrical device used to create artificial light" (wikipedia) -- guess what? @@ -46,7 +48,7 @@ minetest.register_node("mesecons_lamp:lamp_off", { node_box = mesecon_lamp_box, selection_box = mesecon_lamp_box, groups = {dig_immediate=3, mesecon_receptor_off = 1, mesecon_effector_off = 1}, - description = "Mesecon Lamp", + description = S("Mesecon Lamp"), sounds = default.node_sound_glass_defaults(), mesecons = {effector = { action_on = function (pos, node) diff --git a/mesecons_lightstone/init.lua b/mesecons_lightstone/init.lua index 4e56ba2..1bedaf9 100644 --- a/mesecons_lightstone/init.lua +++ b/mesecons_lightstone/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_lightstone") + local lightstone_rules = { {x=0, y=0, z=-1}, {x=1, y=0, z=0}, @@ -16,7 +18,7 @@ local lightstone_rules = { function mesecon.lightstone_add(name, base_item, texture_off, texture_on, desc) if not desc then - desc = name .. " Lightstone" + desc = S("Lightstone (@1)", name) end minetest.register_node("mesecons_lightstone:lightstone_" .. name .. "_off", { tiles = {texture_off}, @@ -59,15 +61,15 @@ function mesecon.lightstone_add(name, base_item, texture_off, texture_on, desc) end -mesecon.lightstone_add("red", "dye:red", "jeija_lightstone_red_off.png", "jeija_lightstone_red_on.png", "Red Lightstone") -mesecon.lightstone_add("green", "dye:green", "jeija_lightstone_green_off.png", "jeija_lightstone_green_on.png", "Green Lightstone") -mesecon.lightstone_add("blue", "dye:blue", "jeija_lightstone_blue_off.png", "jeija_lightstone_blue_on.png", "Blue Lightstone") -mesecon.lightstone_add("gray", "dye:grey", "jeija_lightstone_gray_off.png", "jeija_lightstone_gray_on.png", "Grey Lightstone") -mesecon.lightstone_add("darkgray", "dye:dark_grey", "jeija_lightstone_darkgray_off.png", "jeija_lightstone_darkgray_on.png", "Dark Grey Lightstone") -mesecon.lightstone_add("yellow", "dye:yellow", "jeija_lightstone_yellow_off.png", "jeija_lightstone_yellow_on.png", "Yellow Lightstone") -mesecon.lightstone_add("orange", "dye:orange", "jeija_lightstone_orange_off.png", "jeija_lightstone_orange_on.png", "Orange Lightstone") -mesecon.lightstone_add("white", "dye:white", "jeija_lightstone_white_off.png", "jeija_lightstone_white_on.png", "White Lightstone") -mesecon.lightstone_add("pink", "dye:pink", "jeija_lightstone_pink_off.png", "jeija_lightstone_pink_on.png", "Pink Lightstone") -mesecon.lightstone_add("magenta", "dye:magenta", "jeija_lightstone_magenta_off.png", "jeija_lightstone_magenta_on.png", "Magenta Lightstone") -mesecon.lightstone_add("cyan", "dye:cyan", "jeija_lightstone_cyan_off.png", "jeija_lightstone_cyan_on.png", "Cyan Lightstone") -mesecon.lightstone_add("violet", "dye:violet", "jeija_lightstone_violet_off.png", "jeija_lightstone_violet_on.png", "Violet Lightstone") +mesecon.lightstone_add("red", "dye:red", "jeija_lightstone_red_off.png", "jeija_lightstone_red_on.png", S("Red Lightstone")) +mesecon.lightstone_add("green", "dye:green", "jeija_lightstone_green_off.png", "jeija_lightstone_green_on.png", S("Green Lightstone")) +mesecon.lightstone_add("blue", "dye:blue", "jeija_lightstone_blue_off.png", "jeija_lightstone_blue_on.png", S("Blue Lightstone")) +mesecon.lightstone_add("gray", "dye:grey", "jeija_lightstone_gray_off.png", "jeija_lightstone_gray_on.png", S("Grey Lightstone")) +mesecon.lightstone_add("darkgray", "dye:dark_grey", "jeija_lightstone_darkgray_off.png", "jeija_lightstone_darkgray_on.png", S("Dark Grey Lightstone")) +mesecon.lightstone_add("yellow", "dye:yellow", "jeija_lightstone_yellow_off.png", "jeija_lightstone_yellow_on.png", S("Yellow Lightstone")) +mesecon.lightstone_add("orange", "dye:orange", "jeija_lightstone_orange_off.png", "jeija_lightstone_orange_on.png", S("Orange Lightstone")) +mesecon.lightstone_add("white", "dye:white", "jeija_lightstone_white_off.png", "jeija_lightstone_white_on.png", S("White Lightstone")) +mesecon.lightstone_add("pink", "dye:pink", "jeija_lightstone_pink_off.png", "jeija_lightstone_pink_on.png", S("Pink Lightstone")) +mesecon.lightstone_add("magenta", "dye:magenta", "jeija_lightstone_magenta_off.png", "jeija_lightstone_magenta_on.png", S("Magenta Lightstone")) +mesecon.lightstone_add("cyan", "dye:cyan", "jeija_lightstone_cyan_off.png", "jeija_lightstone_cyan_on.png", S("Cyan Lightstone")) +mesecon.lightstone_add("violet", "dye:violet", "jeija_lightstone_violet_off.png", "jeija_lightstone_violet_on.png", S("Violet Lightstone")) diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua index 1c93e48..39fd7e6 100644 --- a/mesecons_luacontroller/init.lua +++ b/mesecons_luacontroller/init.lua @@ -1,3 +1,6 @@ +local S = minetest.get_translator("mesecons_luacontroller") +local F = minetest.formspec_escape + -- ______ -- | -- | @@ -273,7 +276,7 @@ if mesecon.setting("luacontroller_lightweight_interrupts", false) then get_interrupt = function(pos, itbl, send_warning) return (function(time, iid) if type(time) ~= "number" then error("Delay must be a number") end - if iid ~= nil then send_warning("Interrupt IDs are disabled on this server") end + if iid ~= nil then send_warning(S("Interrupt IDs are disabled on this server")) end table.insert(itbl, function() minetest.get_node_timer(pos):start(time) end) end) end @@ -297,7 +300,7 @@ else if #msg_ser <= mesecon.setting("luacontroller_interruptid_maxlen", 256) then mesecon.queue:add_action(pos, "lc_interrupt", {luac_id, iid}, time, iid, 1) else - send_warning("An interrupt ID was too large!") + send_warning(S("An interrupt ID was too large!")) end end) end @@ -403,18 +406,18 @@ local function get_digiline_send(pos, itbl, send_warning) -- Make sure channel is string, number or boolean if type(channel) == "string" then if #channel > chan_maxlen then - send_warning("Channel string too long.") + send_warning(S("Channel string too long.")) return false end elseif (type(channel) ~= "string" and type(channel) ~= "number" and type(channel) ~= "boolean") then - send_warning("Channel must be string, number or boolean.") + send_warning(S("Channel must be string, number or boolean.")) return false end local msg_cost msg, msg_cost = clean_and_weigh_digiline_message(msg) if msg == nil or msg_cost > maxlen then - send_warning("Message was too complex, or contained invalid data.") + send_warning(S("Message was too complex, or contained invalid data.")) return false end @@ -587,7 +590,7 @@ local function run_inner(pos, code, event) -- 'Last warning' label. local warning = "" local function send_warning(str) - warning = "Warning: " .. str + warning = S("Warning: @1", str) end -- Create environment @@ -607,7 +610,7 @@ local function run_inner(pos, code, event) -- End string true sandboxing if not success then return false, msg end if type(env.port) ~= "table" then - return false, "Ports set are invalid." + return false, S("Ports set are invalid.") end -- Actually set the ports @@ -633,9 +636,10 @@ local function reset_formspec(meta, code, errmsg) errmsg = minetest.formspec_escape(tostring(errmsg or "")) meta:set_string("formspec", "size[12,10]" .."background[-0.2,-0.25;12.4,10.75;jeija_luac_background.png]" + .."label[5.5,-0.375;"..F(S("Luacontroller")).."]" .."label[0.1,8.3;"..errmsg.."]" .."textarea[0.2,0.2;12.2,9.5;code;;"..code.."]" - .."image_button[4.75,8.75;2.5,1;jeija_luac_runbutton.png;program;]" + .."button[4.75,8.75;2.5,1;program;"..F(S("Execute")).."]" .."image_button_exit[11.72,-0.25;0.425,0.4;jeija_close_window.png;exit;]" ) end @@ -807,7 +811,7 @@ for d = 0, 1 do } minetest.register_node(node_name, { - description = "Luacontroller", + description = S("Luacontroller"), drawtype = "nodebox", tiles = { top, diff --git a/mesecons_luacontroller/textures/jeija_luac_background.png b/mesecons_luacontroller/textures/jeija_luac_background.png index f2a07e1b6ae300736f066a9a87f23f86476a7d0a..333b96c12da1eef4a863ad4b8740a0bd9dca8e83 100644 GIT binary patch literal 520 zcmeAS@N?(olHy`uVBq!ia0y~yV0;I}hnSdwA|c|3I)D^sfKP~P;@Vsw69|NZ7RLiA zrjj7P;QtIyw;Ol?)vxh%aSW+od~=qSvB7|W!9ePfY6hF;%Yx}^4~Q`=s4usjy~pI| z=g^O*lutY@+8Lua{q!KADsAyNNBaE#vR4kyNd|081y1Y@iz?^aTQD>|`5XUK?eF&X z-O&%?SG=3nGxMo)B>(SdH81)gJO%Bd+DoVHb zm^fSSK>2g^{=)~XmAFD*J@3t$b9&AVjl-SH%F`ZjEZ-by_~c$K`|b~aXWeL6Sokf@ zyI|sj@2WCMz5Iq!?+Y)wTCCD|;;j+Vp7p{uZ!5?5AC((@6@Rd3`uv%dR=l@3zNP(B z7cYy4p@h=XV~M6FSDs}1*@h^n{64Pz;s34Y`~M!4|8wwtLp}57bw!ptRw+q>V$;*r K&t;ucLK6T`f%HZI literal 655 zcmeAS@N?(olHy`uVBq!ia0y~yV0;I}hnSdwA|c|3I)D^sfKQ0)^KC#DL*m-pH9||K z09lMBL4Lsu4$p3+F)%Qhc)B=-RNQ)V#g^}o0z<>axI?o~9unN)FF7Y>SAkdKEH`2C z#S1s?>;J+&ZMx8{!+AwohH7zSeE&N#QcwU-g`&7Jy4ux`*GJ%%_TegFC3pE zbuW#1o2}iH-)kPewPeay{e0iuzlnd`W|ek(``Yt`huv!`ZHqLgeLWDmZGZdk zR}=pid{BOH$-b0pcS+mfhXocgeC>mU`k}r<#q-kIxke{?1=<#7JXz{5^mIztG|Qvn zt2LItDVH$2x+2z~B=B#$g5buABW4_mEdovmV$bqVM{Z9Ivzce|SfqaPZ_^v`Cr&pP ztuFYXwc5n*)s~~}avM%oi!GKq^{UzXn1uAk0Aq`%J(=I{9dJ{@KSC^%wEWdDBxYH2se8-*BI$bJ&Bb6I1Do{0eia(9A!n&$rLk%bq9Ammpq$`#{krwso_NIn&Q-rkmeb z{cOI+?)3EaH}1~M%x6r`H@EvGQQi5}e)rtcd1qLbXZ$gc`*AIHf0^Qu`Ul+nHOT_~ SIac1Fbmi&l=d#Wzp$Pyd+A3rK diff --git a/mesecons_luacontroller/textures/jeija_luac_runbutton.png b/mesecons_luacontroller/textures/jeija_luac_runbutton.png deleted file mode 100644 index f43b571c42a45c133e8724176cbc9341350acc38..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2150 zcmZwJc{JPE9suxEt7xNiXlc*%)tP5>(RQ>trj}NzR2NGJ)zT_awbfRH*q5p;6jeo( zVJt-?5@HJ?L_{r#Er?xW{n-hzWxQWr|9j`%^SSq)d%pMF{f`^-#7JNA*x6$c2t@MX z13eS4-UYLr_+hY2do`*BfrvbPVqgXXoA44>IM&rx$n7=O{WZ?r4(IU(RQk?d$kU>+tqwz0hx^sM_pgZvAbkiFiVUg+MFrPJhtz>$LhE9}>SM#|QQ;tR+h)f!8s2!%%jWpJeG&PJiQ^shGLM=_>E!1&(^F%9cvaMyZjXv2<=d`zSI=*u{ z+qjH&F0*5b**VqSIo-{e?qSaKcF(eUg!+5u`upYvSo7@udG^5k&;T$r2n@493nN1d zqr;11Ba36BOA}*DljF-E&crfja)rxTnc}QYaaX6OR%fQyW@pysX4mKE)`9sA&;kJB zEiUjD7kNvIo6Ac=E6ZCeD_g6p{Ixay`Z|AOeS2eLo5$PcZSHLGcel6qws-b+cJ_96 z_d$Dm`+NI>eStu5aBwiSei02mtV7-=My8OvGlTXJh-kw@JsmUT&>~akBt$_RqLM(W z`~_O0b$r{Leb%K*vOAIVKWSIAkF{V^9HMJwb(<>zSY-T&@BVbI?wZ@=spPZE1)b5x zC%=*Ftqq(LD{jbzntQGKOhs|FzmGZ$S7Iw%hbx8lYIbUa8*0)sQ}dScF06DoumZgt z0<>M#GLvztfTxTlpo-_XXMK%oP+Qklw?&std_mm^{&{|dMt0npHh1Qb2r6=S=V&dT z{g28TIu<9(lqf!Ed@AovyAu=d@B|F5X z4y;WI4%fYd%cmZ>6-k(Fol%Q%kT*Pn8mn%yQWi(*SzCcaYCv1^${8;!rQ*8V#V1y& zDg7qR4)I9Vy~m&NYBPs#<>K6Q@13i(gt zIXOz!FU^$?WBR^B83ik2n6!zTsf8I`=I4LSvgcRFaxu3<|GjqshT|&*Ei_j_r^|Jn-vI%E>V1Wkys@ni_Je8rK1qN zR7;OZjARJzjt+{7Tzc^$Ph`Ld-x~A_quwe>T<(pgxR#RezW+?1Z)6&GD|{NiQV)k7 zbc>C7m?Zeb868S*rpc|@PVI#_^G@kpO4^@kT5l#>q+4cZSI}IlZfJDe5>bT*z4#ff z-{qtnN{oM|XK9N^#oYMq+OIB=xJC(!lenWM&v)^<4EUu>C$pTdAYCVY#SINmtB_Wc za9RDh7%)`T%fU<>aY3M@20u3fLL)5N4!@)3piz590;I A_5c6? diff --git a/mesecons_materials/init.lua b/mesecons_materials/init.lua index eb19c3e..a73ddac 100644 --- a/mesecons_materials/init.lua +++ b/mesecons_materials/init.lua @@ -1,14 +1,16 @@ +local S = minetest.get_translator("mesecons_materials") + -- Glue and fiber minetest.register_craftitem("mesecons_materials:glue", { image = "mesecons_glue.png", on_place_on_ground = minetest.craftitem_place_item, - description="Glue", + description=S("Glue"), }) minetest.register_craftitem("mesecons_materials:fiber", { image = "mesecons_fiber.png", on_place_on_ground = minetest.craftitem_place_item, - description="Fiber", + description=S("Fiber"), }) minetest.register_craft({ @@ -29,7 +31,7 @@ minetest.register_craft({ minetest.register_craftitem("mesecons_materials:silicon", { image = "mesecons_silicon.png", on_place_on_ground = minetest.craftitem_place_item, - description="Silicon", + description=S("Silicon"), }) minetest.register_craft({ diff --git a/mesecons_microcontroller/init.lua b/mesecons_microcontroller/init.lua index f9ba979..99fe220 100644 --- a/mesecons_microcontroller/init.lua +++ b/mesecons_microcontroller/init.lua @@ -1,3 +1,6 @@ +local S = minetest.get_translator("mesecons_microcontroller") +local F = minetest.formspec_escape + local EEPROM_SIZE = 255 local microc_rules = {} @@ -56,7 +59,7 @@ if nodename ~= "mesecons_microcontroller:microcontroller0000" then end minetest.register_node(nodename, { - description = "Microcontroller", + description = S("Microcontroller"), drawtype = "nodebox", tiles = { top, @@ -89,15 +92,15 @@ minetest.register_node(nodename, { local meta = minetest.get_meta(pos) meta:set_string("code", "") meta:set_string("formspec", "size[9,2.5]".. - "field[0.256,-0.2;9,2;code;Code:;]".. - "button[0 ,0.2;1.5,3;band;AND]".. - "button[1.5,0.2;1.5,3;bxor;XOR]".. - "button[3 ,0.2;1.5,3;bnot;NOT]".. - "button[4.5,0.2;1.5,3;bnand;NAND]".. - "button[6 ,0.2;1.5,3;btflop;T-Flop]".. - "button[7.5,0.2;1.5,3;brsflop;RS-Flop]".. - "button_exit[3.5,1;2,3;program;Program]") - meta:set_string("infotext", "Unprogrammed Microcontroller") + "field[0.256,-0.2;9,2;code;"..F(S("Code:"))..";]".. + "button[0 ,0.2;1.5,3;band;"..F(S("AND")).."]".. + "button[1.5,0.2;1.5,3;bxor;"..F(S("XOR")).."]".. + "button[3 ,0.2;1.5,3;bnot;"..F(S("NOT")).."]".. + "button[4.5,0.2;1.5,3;bnand;"..F(S("NAND")).."]".. + "button[6 ,0.2;1.5,3;btflop;"..F(S("T-Flop")).."]".. + "button[7.5,0.2;1.5,3;brsflop;"..F(S("RS-Flop")).."]".. + "button_exit[3.5,1;2,3;program;"..F(S("Program")).."]") + meta:set_string("infotext", S("Unprogrammed Microcontroller")) local r = "" for i=1, EEPROM_SIZE+1 do r=r.."0" end --Generate a string with EEPROM_SIZE*"0" meta:set_string("eeprom", r) @@ -127,15 +130,15 @@ minetest.register_node(nodename, { meta:set_string("code", fields.code) meta:set_string("formspec", "size[9,2.5]".. - "field[0.256,-0.2;9,2;code;Code:;"..minetest.formspec_escape(fields.code).."]".. - "button[0 ,0.2;1.5,3;band;AND]".. - "button[1.5,0.2;1.5,3;bxor;XOR]".. - "button[3 ,0.2;1.5,3;bnot;NOT]".. - "button[4.5,0.2;1.5,3;bnand;NAND]".. - "button[6 ,0.2;1.5,3;btflop;T-Flop]".. - "button[7.5,0.2;1.5,3;brsflop;RS-Flop]".. - "button_exit[3.5,1;2,3;program;Program]") - meta:set_string("infotext", "Programmed Microcontroller") + "field[0.256,-0.2;9,2;code;"..F(S("Code:"))..";"..minetest.formspec_escape(fields.code).."]".. + "button[0 ,0.2;1.5,3;band;"..F(S("AND")).."]".. + "button[1.5,0.2;1.5,3;bxor;"..F(S("XOR")).."]".. + "button[3 ,0.2;1.5,3;bnot;"..F(S("NOT")).."]".. + "button[4.5,0.2;1.5,3;bnand;"..F(S("NAND")).."]".. + "button[6 ,0.2;1.5,3;btflop;"..F(S("T-Flop")).."]".. + "button[7.5,0.2;1.5,3;brsflop;"..F(S("RS-Flop")).."]".. + "button_exit[3.5,1;2,3;program;"..F(S("Program")).."]") + meta:set_string("infotext", S("Programmed Microcontroller")) yc.reset (pos) yc.update(pos) end, @@ -199,9 +202,9 @@ yc.update = function(pos) code = string.gsub(code, " ", "") --Remove all spaces code = string.gsub(code, " ", "") --Remove all tabs if yc.parsecode(code, pos) == nil then - meta:set_string("infotext", "Code not valid!\n"..code) + meta:set_string("infotext", S("Code not valid!").."\n"..code) else - meta:set_string("infotext", "Working Microcontroller\n"..code) + meta:set_string("infotext", S("Working Microcontroller").."\n"..code) end end @@ -467,12 +470,12 @@ yc.command_after_execute = function(params) local meta = minetest.get_meta(params.pos) if meta:get_int("afterid") == params.afterid then --make sure the node has not been changed if yc.parsecode(params.code, params.pos) == nil then - meta:set_string("infotext", "Code in after() not valid!") + meta:set_string("infotext", S("Code in after() not valid!")) else if code ~= nil then - meta:set_string("infotext", "Working Microcontroller\n"..code) + meta:set_string("infotext", S("Working Microcontroller").."\n"..code) else - meta:set_string("infotext", "Working Microcontroller") + meta:set_string("infotext", S("Working Microcontroller")) end end end diff --git a/mesecons_movestones/init.lua b/mesecons_movestones/init.lua index 49ac2b5..53eb5db 100644 --- a/mesecons_movestones/init.lua +++ b/mesecons_movestones/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_movestone") + -- MOVESTONE -- Non-sticky: -- Moves along mesecon lines @@ -127,7 +129,7 @@ mesecon.register_movestone("mesecons_movestones:movestone", { "jeija_movestone_arrows.png", }, groups = {cracky = 3}, - description = "Movestone", + description = S("Movestone"), sounds = default.node_sound_stone_defaults() }, false, false) @@ -141,7 +143,7 @@ mesecon.register_movestone("mesecons_movestones:sticky_movestone", { "jeija_sticky_movestone.png", }, groups = {cracky = 3}, - description = "Sticky Movestone", + description = S("Sticky Movestone"), sounds = default.node_sound_stone_defaults(), }, true, false) @@ -155,7 +157,7 @@ mesecon.register_movestone("mesecons_movestones:movestone_vertical", { "jeija_movestone_arrows.png^[transformR90", }, groups = {cracky = 3}, - description = "Vertical Movestone", + description = S("Vertical Movestone"), sounds = default.node_sound_stone_defaults() }, false, true) @@ -169,7 +171,7 @@ mesecon.register_movestone("mesecons_movestones:sticky_movestone_vertical", { "jeija_movestone_arrows.png^[transformR90", }, groups = {cracky = 3}, - description = "Vertical Sticky Movestone", + description = S("Vertical Sticky Movestone"), sounds = default.node_sound_stone_defaults(), }, true, true) diff --git a/mesecons_noteblock/init.lua b/mesecons_noteblock/init.lua index 22755ef..caafeff 100644 --- a/mesecons_noteblock/init.lua +++ b/mesecons_noteblock/init.lua @@ -1,5 +1,7 @@ +local S = minetest.get_translator("mesecons_noteblock") + minetest.register_node("mesecons_noteblock:noteblock", { - description = "Noteblock", + description = S("Noteblock"), tiles = {"mesecons_noteblock.png"}, is_ground_content = false, groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2}, diff --git a/mesecons_pistons/init.lua b/mesecons_pistons/init.lua index 1af80c5..a696971 100644 --- a/mesecons_pistons/init.lua +++ b/mesecons_pistons/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_pistons") + local specs = { normal = { offname = "mesecons_pistons:piston_normal_off", @@ -274,7 +276,7 @@ local piston_on_box = { -- Normal (non-sticky) Pistons: -- offstate minetest.register_node("mesecons_pistons:piston_normal_off", { - description = "Piston", + description = S("Piston"), tiles = { "mesecons_piston_top.png", "mesecons_piston_bottom.png", @@ -299,7 +301,7 @@ minetest.register_node("mesecons_pistons:piston_normal_off", { -- onstate minetest.register_node("mesecons_pistons:piston_normal_on", { - description = "Activated Piston Base", + description = S("Activated Piston Base"), drawtype = "nodebox", tiles = { "mesecons_piston_top.png", @@ -328,7 +330,7 @@ minetest.register_node("mesecons_pistons:piston_normal_on", { -- pusher minetest.register_node("mesecons_pistons:piston_pusher_normal", { - description = "Piston Pusher", + description = S("Piston Pusher"), drawtype = "nodebox", tiles = { "mesecons_piston_pusher_top.png", @@ -353,7 +355,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_normal", { -- Sticky ones -- offstate minetest.register_node("mesecons_pistons:piston_sticky_off", { - description = "Sticky Piston", + description = S("Sticky Piston"), tiles = { "mesecons_piston_top.png", "mesecons_piston_bottom.png", @@ -378,7 +380,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", { -- onstate minetest.register_node("mesecons_pistons:piston_sticky_on", { - description = "Activated Sticky Piston Base", + description = S("Activated Sticky Piston Base"), drawtype = "nodebox", tiles = { "mesecons_piston_top.png", @@ -407,7 +409,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", { -- pusher minetest.register_node("mesecons_pistons:piston_pusher_sticky", { - description = "Sticky Piston Pusher", + description = S("Sticky Piston Pusher"), drawtype = "nodebox", tiles = { "mesecons_piston_pusher_top.png", diff --git a/mesecons_powerplant/init.lua b/mesecons_powerplant/init.lua index 356fb12..5ae1ead 100644 --- a/mesecons_powerplant/init.lua +++ b/mesecons_powerplant/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_powerplant") + -- The POWER_PLANT -- Just emits power. always. @@ -11,7 +13,7 @@ minetest.register_node("mesecons_powerplant:power_plant", { walkable = false, groups = {dig_immediate=3, mesecon = 2}, light_source = minetest.LIGHT_MAX-9, - description="Power Plant", + description=S("Power Plant"), selection_box = { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, -0.5+0.7, 0.3}, diff --git a/mesecons_pressureplates/init.lua b/mesecons_pressureplates/init.lua index 1a503e9..3669bd5 100644 --- a/mesecons_pressureplates/init.lua +++ b/mesecons_pressureplates/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_pressureplates") + local pp_box_off = { type = "fixed", fixed = { -7/16, -8/16, -7/16, 7/16, -7/16, 7/16 }, @@ -89,7 +91,7 @@ end mesecon.register_pressure_plate( "mesecons_pressureplates:pressure_plate_wood", - "Wooden Pressure Plate", + S("Wooden Pressure Plate"), {"jeija_pressure_plate_wood_off.png","jeija_pressure_plate_wood_off.png","jeija_pressure_plate_wood_off_edges.png"}, {"jeija_pressure_plate_wood_on.png","jeija_pressure_plate_wood_on.png","jeija_pressure_plate_wood_on_edges.png"}, "jeija_pressure_plate_wood_wield.png", @@ -100,7 +102,7 @@ mesecon.register_pressure_plate( mesecon.register_pressure_plate( "mesecons_pressureplates:pressure_plate_stone", - "Stone Pressure Plate", + S("Stone Pressure Plate"), {"jeija_pressure_plate_stone_off.png","jeija_pressure_plate_stone_off.png","jeija_pressure_plate_stone_off_edges.png"}, {"jeija_pressure_plate_stone_on.png","jeija_pressure_plate_stone_on.png","jeija_pressure_plate_stone_on_edges.png"}, "jeija_pressure_plate_stone_wield.png", diff --git a/mesecons_random/init.lua b/mesecons_random/init.lua index 0536007..60f1b5a 100644 --- a/mesecons_random/init.lua +++ b/mesecons_random/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_random") + -- REMOVESTONE minetest.register_node("mesecons_random:removestone", { @@ -5,7 +7,7 @@ minetest.register_node("mesecons_random:removestone", { is_ground_content = false, inventory_image = minetest.inventorycube("jeija_removestone_inv.png"), groups = {cracky=3}, - description="Removestone", + description=S("Removestone"), sounds = default.node_sound_stone_defaults(), mesecons = {effector = { action_on = function (pos, node) @@ -29,7 +31,7 @@ minetest.register_craft({ -- GHOSTSTONE minetest.register_node("mesecons_random:ghoststone", { - description="Ghoststone", + description=S("Ghoststone"), tiles = {"jeija_ghoststone.png"}, is_ground_content = false, inventory_image = minetest.inventorycube("jeija_ghoststone_inv.png"), diff --git a/mesecons_solarpanel/init.lua b/mesecons_solarpanel/init.lua index 861fbcd..fd6e8d4 100644 --- a/mesecons_solarpanel/init.lua +++ b/mesecons_solarpanel/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_solarpanel") + -- Solar Panel minetest.register_node("mesecons_solarpanel:solar_panel_on", { drawtype = "nodebox", @@ -53,7 +55,7 @@ minetest.register_node("mesecons_solarpanel:solar_panel_off", { wall_side = { -8/16, -7/16, -7/16, -7/16, 7/16, 7/16 }, }, groups = {dig_immediate=3}, - description = "Solar Panel", + description = S("Solar Panel"), sounds = default.node_sound_glass_defaults(), mesecons = {receptor = { state = mesecon.state.off, diff --git a/mesecons_stickyblocks/init.lua b/mesecons_stickyblocks/init.lua index 094af09..6c7a5d2 100644 --- a/mesecons_stickyblocks/init.lua +++ b/mesecons_stickyblocks/init.lua @@ -1,10 +1,12 @@ +local S = minetest.get_translator("mesecons_stickyblocks") + -- Sticky blocks can be used together with pistons or movestones to push / pull -- structures that are "glued" together using sticky blocks -- All sides sticky block minetest.register_node("mesecons_stickyblocks:sticky_block_all", { -- TODO: Rename to “All-Faces Sticky Block” when other sticky blocks become available - description = "Sticky Block", + description = S("Sticky Block"), tiles = {"mesecons_stickyblocks_sticky.png"}, is_ground_content = false, groups = {choppy=3, oddly_breakable_by_hand=2}, diff --git a/mesecons_switch/init.lua b/mesecons_switch/init.lua index 7f42253..e374bb9 100644 --- a/mesecons_switch/init.lua +++ b/mesecons_switch/init.lua @@ -1,8 +1,10 @@ +local S = minetest.get_translator("mesecons_switch") + -- mesecons_switch mesecon.register_node("mesecons_switch:mesecon_switch", { paramtype2="facedir", - description="Switch", + description=S("Switch"), is_ground_content = false, sounds = default.node_sound_stone_defaults(), on_rightclick = function (pos, node) diff --git a/mesecons_torch/init.lua b/mesecons_torch/init.lua index 867c909..4af41c0 100644 --- a/mesecons_torch/init.lua +++ b/mesecons_torch/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_torch") + --MESECON TORCHES local rotate_torch_rules = function (rules, param2) @@ -81,7 +83,7 @@ minetest.register_node("mesecons_torch:mesecon_torch_on", { selection_box = torch_selectionbox, groups = {dig_immediate=3}, light_source = minetest.LIGHT_MAX-5, - description="Mesecon Torch", + description=S("Mesecon Torch"), sounds = default.node_sound_defaults(), mesecons = {receptor = { state = mesecon.state.on, diff --git a/mesecons_walllever/init.lua b/mesecons_walllever/init.lua index 1dc08f0..41d05a9 100644 --- a/mesecons_walllever/init.lua +++ b/mesecons_walllever/init.lua @@ -1,8 +1,10 @@ +local S = minetest.get_translator("mesecons_walllever") + -- WALL LEVER -- Basically a switch that can be attached to a wall -- Powers the block 2 nodes behind (using a receiver) mesecon.register_node("mesecons_walllever:wall_lever", { - description="Lever", + description=S("Lever"), drawtype = "mesh", inventory_image = "jeija_wall_lever_inv.png", wield_image = "jeija_wall_lever_inv.png", diff --git a/mesecons_wires/init.lua b/mesecons_wires/init.lua index 3ca9cbc..b405f34 100644 --- a/mesecons_wires/init.lua +++ b/mesecons_wires/init.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("mesecons_wires") + -- naming scheme: wire:(xp)(zp)(xm)(zm)(xpyp)(zpyp)(xmyp)(zmyp)_on/off -- where x= x direction, z= z direction, y= y direction, p = +1, m = -1, e.g. xpym = {x=1, y=-1, z=0} -- The (xp)/(zpyp)/.. statements shall be replaced by either 0 or 1 @@ -202,7 +204,7 @@ local function register_wires() end mesecon.register_node(":mesecons:wire_"..nodeid, { - description = "Mesecon", + description = S("Mesecon"), drawtype = "nodebox", inventory_image = "mesecons_wire_inv.png", wield_image = "mesecons_wire_inv.png",