From ccfb6b4d61ee2742944c71a19b9682b822b86c2b Mon Sep 17 00:00:00 2001 From: Alexander Chibrikin Date: Mon, 23 Oct 2023 21:52:04 +0300 Subject: [PATCH] Translate `worldedit_commands` (#229) --- worldedit_commands/cuboid.lua | 43 ++- worldedit_commands/init.lua | 360 +++++++++--------- worldedit_commands/locale/template.txt | 155 ++++++++ .../locale/worldedit_command.ru.tr | 155 ++++++++ worldedit_commands/safe.lua | 12 +- worldedit_commands/wand.lua | 4 +- 6 files changed, 530 insertions(+), 199 deletions(-) create mode 100644 worldedit_commands/locale/template.txt create mode 100644 worldedit_commands/locale/worldedit_command.ru.tr diff --git a/worldedit_commands/cuboid.lua b/worldedit_commands/cuboid.lua index 93e45fa..1da5d98 100644 --- a/worldedit_commands/cuboid.lua +++ b/worldedit_commands/cuboid.lua @@ -1,6 +1,8 @@ +local S = minetest.get_translator("worldedit_commands") + worldedit.register_command("outset", { params = "[h/v] ", - description = "Outset the selected region.", + description = S("Outset the selected region."), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -11,7 +13,7 @@ worldedit.register_command("outset", { local hv_test = dir:find("[^hv]+") if hv_test ~= nil then - return false, "Invalid direction." + return false, S("Invalid direction: @1", dir) end return true, dir, tonumber(amount) @@ -28,18 +30,18 @@ worldedit.register_command("outset", { assert(worldedit.cuboid_linear_expand(name, 'y', 1, amount)) assert(worldedit.cuboid_linear_expand(name, 'y', -1, amount)) else - return false, "Invalid number of arguments" + return false, S("Invalid number of arguments") end worldedit.marker_update(name) - return true, "Region outset by " .. amount .. " blocks" + return true, S("Region outset by @1 nodes", amount) end, }) worldedit.register_command("inset", { params = "[h/v] ", - description = "Inset the selected region.", + description = S("Inset the selected region."), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -48,7 +50,7 @@ worldedit.register_command("inset", { return false end if dir:find("[^hv]") ~= nil then - return false, "Invalid direction." + return false, S("Invalid direction: @1", dir) end return true, dir, tonumber(amount) @@ -65,18 +67,18 @@ worldedit.register_command("inset", { assert(worldedit.cuboid_linear_expand(name, 'y', 1, -amount)) assert(worldedit.cuboid_linear_expand(name, 'y', -1, -amount)) else - return false, "Invalid number of arguments" + return false, S("Invalid number of arguments") end worldedit.marker_update(name) - return true, "Region inset by " .. amount .. " blocks" + return true, S("Region inset by @1 nodes", amount) end, }) worldedit.register_command("shift", { params = "x/y/z/?/up/down/left/right/front/back [+/-]", - description = "Shifts the selection area without moving its contents", + description = S("Shifts the selection area without moving its contents"), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -98,20 +100,20 @@ worldedit.register_command("shift", { end if axis == nil or dir == nil then - return false, "Invalid if looking straight up or down" + return false, S("Invalid if looking straight up or down") end assert(worldedit.cuboid_shift(name, axis, amount * dir)) worldedit.marker_update(name) - return true, "Region shifted by " .. amount .. " nodes" + return true, S("Region shifted by @1 nodes", amount) end, }) worldedit.register_command("expand", { params = "[+/-]x/y/z/?/up/down/left/right/front/back [reverse amount]", - description = "Expands the selection in the selected absolute or relative axis", + description = S("Expands the selection in the selected absolute or relative axis"), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -135,7 +137,7 @@ worldedit.register_command("expand", { axis, dir = worldedit.translate_direction(name, direction) if axis == nil or dir == nil then - return false, "Invalid if looking straight up or down" + return false, S("Invalid if looking straight up or down") end else if direction == "?" then @@ -153,14 +155,14 @@ worldedit.register_command("expand", { worldedit.cuboid_linear_expand(name, axis, dir, amount) worldedit.cuboid_linear_expand(name, axis, -dir, rev_amount) worldedit.marker_update(name) - return true, "Region expanded by " .. (amount + rev_amount) .. " nodes" + return true, S("Region expanded by @1 nodes", amount + rev_amount) end, }) worldedit.register_command("contract", { params = "[+/-]x/y/z/?/up/down/left/right/front/back [reverse amount]", - description = "Contracts the selection in the selected absolute or relative axis", + description = S("Contracts the selection in the selected absolute or relative axis"), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -184,7 +186,7 @@ worldedit.register_command("contract", { axis, dir = worldedit.translate_direction(name, direction) if axis == nil or dir == nil then - return false, "Invalid if looking straight up or down" + return false, S("Invalid if looking straight up or down") end else if direction == "?" then @@ -202,13 +204,13 @@ worldedit.register_command("contract", { worldedit.cuboid_linear_expand(name, axis, dir, -amount) worldedit.cuboid_linear_expand(name, axis, -dir, -rev_amount) worldedit.marker_update(name) - return true, "Region contracted by " .. (amount + rev_amount) .. " nodes" + return true, S("Region contracted by @1 nodes", amount + rev_amount) end, }) worldedit.register_command("cubeapply", { params = "/( ) [parameters]", - description = "Select a cube with side length around position 1 and run on region", + description = S("Select a cube with side length around position 1 and run on region"), privs = {worldedit=true}, require_pos = 1, parse = function(param) @@ -230,7 +232,7 @@ worldedit.register_command("cubeapply", { end local cmddef = worldedit.registered_commands[cmd] if cmddef == nil or cmddef.require_pos ~= 2 then - return false, "invalid usage: //" .. cmd .. " cannot be used with cubeapply" + return false, S("invalid usage: //@1 cannot be used with cubeapply", cmd) end -- run parsing of target command local parsed = {cmddef.parse(args)} @@ -247,8 +249,7 @@ worldedit.register_command("cubeapply", { local cmddef = assert(worldedit.registered_commands[cmd]) local success, missing_privs = minetest.check_player_privs(name, cmddef.privs) if not success then - worldedit.player_notify(name, "Missing privileges: " .. - table.concat(missing_privs, ", ")) + worldedit.player_notify(name, S("Missing privileges: @1", table.concat(missing_privs, ", "))) return end diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 9bc2366..2dda953 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -1,4 +1,6 @@ -minetest.register_privilege("worldedit", "Can use WorldEdit commands") +local S = minetest.get_translator("worldedit_commands") + +minetest.register_privilege("worldedit", S("Can use WorldEdit commands")) worldedit.pos1 = {} worldedit.pos2 = {} @@ -24,13 +26,13 @@ local function chatcommand_handler(cmd_name, name, param) if def.require_pos == 2 then local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] if pos1 == nil or pos2 == nil then - worldedit.player_notify(name, "no region selected") + worldedit.player_notify(name, S("no region selected")) return end elseif def.require_pos == 1 then local pos1 = worldedit.pos1[name] if pos1 == nil then - worldedit.player_notify(name, "no position 1 selected") + worldedit.player_notify(name, S("no position 1 selected")) return end end @@ -38,7 +40,7 @@ local function chatcommand_handler(cmd_name, name, param) local parsed = {def.parse(param)} local success = table.remove(parsed, 1) if not success then - worldedit.player_notify(name, parsed[1] or "invalid usage") + worldedit.player_notify(name, parsed[1] or S("invalid usage")) return end @@ -241,7 +243,7 @@ local function open_schematic(name, param) end end if err then - worldedit.player_notify(name, "Could not open file \"" .. param .. "\"") + worldedit.player_notify(name, S("Could not open file \"@1\"", param)) return end local value = file:read("*a") @@ -249,10 +251,10 @@ local function open_schematic(name, param) local version = worldedit.read_header(value) if version == nil or version == 0 then - worldedit.player_notify(name, "File is invalid!") + worldedit.player_notify(name, S("Invalid file format!")) return elseif version > worldedit.LATEST_SERIALIZATION_VERSION then - worldedit.player_notify(name, "Schematic was created with a newer version of WorldEdit.") + worldedit.player_notify(name, S("Schematic was created with a newer version of WorldEdit.")) return end @@ -263,12 +265,14 @@ end worldedit.register_command("about", { privs = {}, params = "", - description = "Get information about the WorldEdit mod", + description = S("Get information about the WorldEdit mod"), func = function(name) - worldedit.player_notify(name, "WorldEdit " .. worldedit.version_string.. + worldedit.player_notify(name, S("WorldEdit @1".. " is available on this server. Type //help to get a list of ".. - "commands, or get more information at ".. - "https://github.com/Uberi/Minetest-WorldEdit") + "commands, or get more information at @2", + worldedit.version_string, + "https://github.com/Uberi/Minetest-WorldEdit" + )) end, }) @@ -276,7 +280,7 @@ worldedit.register_command("about", { worldedit.register_command("help", { privs = {}, params = "[all/]", - description = "Get help for WorldEdit commands", + description = S("Get help for WorldEdit commands"), parse = function(param) return true, param end, @@ -293,7 +297,7 @@ worldedit.register_command("help", { end if not minetest.check_player_privs(name, "worldedit") then - return false, "You are not allowed to use any WorldEdit commands." + return false, S("You are not allowed to use any WorldEdit commands.") end if param == "" then local cmds = {} @@ -303,9 +307,9 @@ worldedit.register_command("help", { end end table.sort(cmds) - return true, "Available commands: " .. table.concat(cmds, " ") .. "\n" + return true, S("Available commands: @1@n" .. "Use '//help ' to get more information," - .. " or '//help all' to list everything." + .. " or '//help all' to list everything.", table.concat(cmds, " ")) elseif param == "all" then local cmds = {} for cmd, def in pairs(worldedit.registered_commands) do @@ -314,11 +318,11 @@ worldedit.register_command("help", { end end table.sort(cmds) - return true, "Available commands:\n"..table.concat(cmds, "\n") + return true, S("Available commands:@n") .. table.concat(cmds, "\n") else local def = worldedit.registered_commands[param] if not def then - return false, "Command not available: " .. param + return false, S("Command not available: ") .. param else return true, format_help_line(param, def) end @@ -328,7 +332,7 @@ worldedit.register_command("help", { worldedit.register_command("inspect", { params = "[on/off/1/0/true/false/yes/no/enable/disable]", - description = "Enable or disable node inspection", + description = S("Enable or disable node inspection"), privs = {worldedit=true}, parse = function(param) if param == "on" or param == "1" or param == "true" or param == "yes" or param == "enable" or param == "" then @@ -342,11 +346,14 @@ worldedit.register_command("inspect", { if enable then worldedit.inspect[name] = true local axis, sign = worldedit.player_axis(name) - worldedit.player_notify(name, string.format("inspector: inspection enabled for %s, currently facing the %s axis", - name, axis .. (sign > 0 and "+" or "-"))) + worldedit.player_notify(name, S( + "inspector: inspection enabled for @1, currently facing the @2 axis", + name, + axis .. (sign > 0 and "+" or "-") + )) else worldedit.inspect[name] = nil - worldedit.player_notify(name, "inspector: inspection disabled") + worldedit.player_notify(name, S("inspector: inspection disabled")) end end, }) @@ -371,15 +378,22 @@ minetest.register_on_punchnode(function(pos, node, puncher) local name = puncher:get_player_name() if worldedit.inspect[name] then local axis, sign = worldedit.player_axis(name) - local message = string.format("inspector: %s at %s (param1=%d, param2=%d, received light=%d) punched facing the %s axis", - node.name, minetest.pos_to_string(pos), node.param1, node.param2, get_node_rlight(pos), axis .. (sign > 0 and "+" or "-")) + local message = S( + S("inspector: @1 at @2 (param1=@3, param2=@4, received light=@5) punched facing the @6 axis"), + node.name, + minetest.pos_to_string(pos), + node.param1, + node.param2, + get_node_rlight(pos), + axis .. (sign > 0 and "+" or "-") + ) worldedit.player_notify(name, message) end end) worldedit.register_command("reset", { params = "", - description = "Reset the region so that it is empty", + description = S("Reset the region so that it is empty"), privs = {worldedit=true}, func = function(name) worldedit.pos1[name] = nil @@ -388,23 +402,23 @@ worldedit.register_command("reset", { worldedit.set_pos[name] = nil --make sure the user does not try to confirm an operation after resetting pos: reset_pending(name) - worldedit.player_notify(name, "region reset") + worldedit.player_notify(name, S("region reset")) end, }) worldedit.register_command("mark", { params = "", - description = "Show markers at the region positions", + description = S("Show markers at the region positions"), privs = {worldedit=true}, func = function(name) worldedit.marker_update(name) - worldedit.player_notify(name, "region marked") + worldedit.player_notify(name, S("region marked")) end, }) worldedit.register_command("unmark", { params = "", - description = "Hide markers if currently shown", + description = S("Hide markers if currently shown"), privs = {worldedit=true}, func = function(name) local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] @@ -413,66 +427,66 @@ worldedit.register_command("unmark", { worldedit.marker_update(name) worldedit.pos1[name] = pos1 worldedit.pos2[name] = pos2 - worldedit.player_notify(name, "region unmarked") + worldedit.player_notify(name, S("region unmarked")) end, }) worldedit.register_command("pos1", { params = "", - description = "Set WorldEdit region position 1 to the player's location", + description = S("Set WorldEdit region position @1 to the player's location", 1), privs = {worldedit=true}, func = function(name) local pos = minetest.get_player_by_name(name):get_pos() pos.x, pos.y, pos.z = math.floor(pos.x + 0.5), math.floor(pos.y + 0.5), math.floor(pos.z + 0.5) worldedit.pos1[name] = pos worldedit.mark_pos1(name) - worldedit.player_notify(name, "position 1 set to " .. minetest.pos_to_string(pos)) + worldedit.player_notify(name, S("position @1 set to @2", 1, minetest.pos_to_string(pos))) end, }) worldedit.register_command("pos2", { params = "", - description = "Set WorldEdit region position 2 to the player's location", + description = S("Set WorldEdit region position @1 to the player's location", 2), privs = {worldedit=true}, func = function(name) local pos = minetest.get_player_by_name(name):get_pos() pos.x, pos.y, pos.z = math.floor(pos.x + 0.5), math.floor(pos.y + 0.5), math.floor(pos.z + 0.5) worldedit.pos2[name] = pos worldedit.mark_pos2(name) - worldedit.player_notify(name, "position 2 set to " .. minetest.pos_to_string(pos)) + worldedit.player_notify(name, S("position @1 set to @2", 2, minetest.pos_to_string(pos))) end, }) worldedit.register_command("p", { params = "set/set1/set2/get", - description = "Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching nodes, or display the current WorldEdit region", + description = S("Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching nodes, or display the current WorldEdit region"), privs = {worldedit=true}, parse = function(param) if param == "set" or param == "set1" or param == "set2" or param == "get" then return true, param end - return false, "unknown subcommand: " .. param + return false, S("unknown subcommand: @1", param) end, func = function(name, param) if param == "set" then --set both WorldEdit positions worldedit.set_pos[name] = "pos1" - worldedit.player_notify(name, "select positions by punching two nodes") + worldedit.player_notify(name, S("select positions by punching two nodes")) elseif param == "set1" then --set WorldEdit position 1 worldedit.set_pos[name] = "pos1only" - worldedit.player_notify(name, "select position 1 by punching a node") + worldedit.player_notify(name, S("select position @1 by punching a node", 1)) elseif param == "set2" then --set WorldEdit position 2 worldedit.set_pos[name] = "pos2" - worldedit.player_notify(name, "select position 2 by punching a node") + worldedit.player_notify(name, S("select position @1 by punching a node", 2)) elseif param == "get" then --display current WorldEdit positions if worldedit.pos1[name] ~= nil then - worldedit.player_notify(name, "position 1: " .. minetest.pos_to_string(worldedit.pos1[name])) + worldedit.player_notify(name, S("position @1: @2", 1, minetest.pos_to_string(worldedit.pos1[name]))) else - worldedit.player_notify(name, "position 1 not set") + worldedit.player_notify(name, S("position @1 not set", 1)) end if worldedit.pos2[name] ~= nil then - worldedit.player_notify(name, "position 2: " .. minetest.pos_to_string(worldedit.pos2[name])) + worldedit.player_notify(name, S("position @1: @2", 2, minetest.pos_to_string(worldedit.pos2[name]))) else - worldedit.player_notify(name, "position 2 not set") + worldedit.player_notify(name, S("position @1 not set", 2)) end end end, @@ -480,7 +494,7 @@ worldedit.register_command("p", { worldedit.register_command("fixedpos", { params = "set1/set2 ", - description = "Set a WorldEdit region position to the position at (, , )", + description = S("Set a WorldEdit region position to the position at (, , )"), privs = {worldedit=true}, parse = function(param) local found, _, flag, x, y, z = param:find("^(set[12])%s+([+-]?%d+)%s+([+-]?%d+)%s+([+-]?%d+)$") @@ -493,11 +507,11 @@ worldedit.register_command("fixedpos", { if flag == "set1" then worldedit.pos1[name] = pos worldedit.mark_pos1(name) - worldedit.player_notify(name, "position 1 set to " .. minetest.pos_to_string(pos)) + worldedit.player_notify(name, S("position @1 set to @2", 1, minetest.pos_to_string(pos))) else --flag == "set2" worldedit.pos2[name] = pos worldedit.mark_pos2(name) - worldedit.player_notify(name, "position 2 set to " .. minetest.pos_to_string(pos)) + worldedit.player_notify(name, S("position @1 set to @2", 2, minetest.pos_to_string(pos))) end end, }) @@ -509,17 +523,17 @@ minetest.register_on_punchnode(function(pos, node, puncher) worldedit.pos1[name] = pos worldedit.mark_pos1(name) worldedit.set_pos[name] = "pos2" --set position 2 on the next invocation - worldedit.player_notify(name, "position 1 set to " .. minetest.pos_to_string(pos)) + worldedit.player_notify(name, S("position @1 set to @2", 1, minetest.pos_to_string(pos))) elseif worldedit.set_pos[name] == "pos1only" then --setting position 1 only worldedit.pos1[name] = pos worldedit.mark_pos1(name) worldedit.set_pos[name] = nil --finished setting positions - worldedit.player_notify(name, "position 1 set to " .. minetest.pos_to_string(pos)) + worldedit.player_notify(name, S("position @1 set to @2", 1, minetest.pos_to_string(pos))) elseif worldedit.set_pos[name] == "pos2" then --setting position 2 worldedit.pos2[name] = pos worldedit.mark_pos2(name) worldedit.set_pos[name] = nil --finished setting positions - worldedit.player_notify(name, "position 2 set to " .. minetest.pos_to_string(pos)) + worldedit.player_notify(name, S("position @1 set to @2", 2, minetest.pos_to_string(pos))) elseif worldedit.set_pos[name] == "prob" then --setting Minetest schematic node probabilities worldedit.prob_pos[name] = pos minetest.show_formspec(name, "prob_val_enter", "field[text;;]") @@ -529,7 +543,7 @@ end) worldedit.register_command("volume", { params = "", - description = "Display the volume of the current WorldEdit region", + description = S("Display the volume of the current WorldEdit region"), privs = {worldedit=true}, require_pos = 2, func = function(name) @@ -537,16 +551,19 @@ worldedit.register_command("volume", { local volume = worldedit.volume(pos1, pos2) local abs = math.abs - worldedit.player_notify(name, "current region has a volume of " .. volume .. " nodes (" - .. abs(pos2.x - pos1.x) + 1 .. "*" - .. abs(pos2.y - pos1.y) + 1 .. "*" - .. abs(pos2.z - pos1.z) + 1 .. ")") + worldedit.player_notify(name, S( + "current region has a volume of @1 nodes (@2*@3*@4)", + volume, + abs(pos2.x - pos1.x) + 1, + abs(pos2.y - pos1.y) + 1, + abs(pos2.z - pos1.z) + 1 + )) end, }) worldedit.register_command("deleteblocks", { params = "", - description = "remove all MapBlocks (16x16x16) containing the selected area from the map", + description = S("Remove all MapBlocks (16x16x16) containing the selected area from the map"), privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, @@ -554,35 +571,35 @@ worldedit.register_command("deleteblocks", { local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] local success = minetest.delete_area(pos1, pos2) if success then - worldedit.player_notify(name, "Area deleted.") + worldedit.player_notify(name, S("Area deleted.")) else - worldedit.player_notify(name, "There was an error during deletion of the area.") + worldedit.player_notify(name, S("There was an error during deletion of the area.")) end end, }) worldedit.register_command("set", { params = "", - description = "Set the current WorldEdit region to ", + description = S("Set the current WorldEdit region to "), privs = {worldedit=true}, require_pos = 2, parse = function(param) local node = worldedit.normalize_nodename(param) if not node then - return false, "invalid node name: " .. param + return false, S("invalid node name: @1", param) end return true, node end, nodes_needed = check_region, func = function(name, node) local count = worldedit.set(worldedit.pos1[name], worldedit.pos2[name], node) - worldedit.player_notify(name, count .. " nodes set") + worldedit.player_notify(name, S("@1 nodes set", count)) end, }) worldedit.register_command("param2", { params = "", - description = "Set param2 of all nodes in the current WorldEdit region to ", + description = S("Set param2 of all nodes in the current WorldEdit region to "), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -590,20 +607,20 @@ worldedit.register_command("param2", { if not param2 then return false elseif param2 < 0 or param2 > 255 then - return false, "Param2 is out of range (must be between 0 and 255 inclusive!)" + return false, S("Param2 is out of range (must be between 0 and 255 inclusive!)") end return true, param2 end, nodes_needed = check_region, func = function(name, param2) local count = worldedit.set_param2(worldedit.pos1[name], worldedit.pos2[name], param2) - worldedit.player_notify(name, count .. " nodes altered") + worldedit.player_notify(name, S("@1 nodes altered", count)) end, }) worldedit.register_command("mix", { params = " [count1] [count2] ...", - description = "Fill the current WorldEdit region with a random mix of , ...", + description = S("Fill the current WorldEdit region with a random mix of , ..."), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -617,7 +634,7 @@ worldedit.register_command("mix", { else local node = worldedit.normalize_nodename(nodename) if not node then - return false, "invalid node name: " .. nodename + return false, S("invalid node name: @1", nodename) end nodes[#nodes + 1] = node end @@ -631,7 +648,7 @@ worldedit.register_command("mix", { func = function(name, nodes) local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] local count = worldedit.set(pos1, pos2, nodes) - worldedit.player_notify(name, count .. " nodes set") + worldedit.player_notify(name, S("@1 nodes set", count)) end, }) @@ -642,18 +659,18 @@ local check_replace = function(param) end local newsearchnode = worldedit.normalize_nodename(searchnode) if not newsearchnode then - return false, "invalid search node name: " .. searchnode + return false, S("invalid search node name: @1", searchnode) end local newreplacenode = worldedit.normalize_nodename(replacenode) if not newreplacenode then - return false, "invalid replace node name: " .. replacenode + return false, S("invalid replace node name: @1", replacenode) end return true, newsearchnode, newreplacenode end worldedit.register_command("replace", { params = " ", - description = "Replace all instances of with in the current WorldEdit region", + description = S("Replace all instances of with in the current WorldEdit region"), privs = {worldedit=true}, require_pos = 2, parse = check_replace, @@ -661,7 +678,7 @@ worldedit.register_command("replace", { func = function(name, search_node, replace_node) local count = worldedit.replace(worldedit.pos1[name], worldedit.pos2[name], search_node, replace_node) - worldedit.player_notify(name, count .. " nodes replaced") + worldedit.player_notify(name, S("@1 nodes replaced", count)) end, }) @@ -675,7 +692,7 @@ worldedit.register_command("replaceinverse", { func = function(name, search_node, replace_node) local count = worldedit.replace(worldedit.pos1[name], worldedit.pos2[name], search_node, replace_node, true) - worldedit.player_notify(name, count .. " nodes replaced") + worldedit.player_notify(name, S("@1 nodes replaced", count)) end, }) @@ -686,14 +703,14 @@ local check_cube = function(param) end local node = worldedit.normalize_nodename(nodename) if not node then - return false, "invalid node name: " .. nodename + return false, S("invalid node name: @1", nodename) end return true, tonumber(w), tonumber(h), tonumber(l), node end worldedit.register_command("hollowcube", { params = " ", - description = "Add a hollow cube with its ground level centered at WorldEdit position 1 with dimensions x x , composed of .", + description = S("Add a hollow cube with its ground level centered at WorldEdit position 1 with dimensions x x , composed of ."), privs = {worldedit=true}, require_pos = 1, parse = check_cube, @@ -702,13 +719,13 @@ worldedit.register_command("hollowcube", { end, func = function(name, w, h, l, node) local count = worldedit.cube(worldedit.pos1[name], w, h, l, node, true) - worldedit.player_notify(name, count .. " nodes added") + worldedit.player_notify(name, S("@1 nodes added", count)) end, }) worldedit.register_command("cube", { params = " ", - description = "Add a cube with its ground level centered at WorldEdit position 1 with dimensions x x , composed of .", + description = S("Add a cube with its ground level centered at WorldEdit position 1 with dimensions x x , composed of ."), privs = {worldedit=true}, require_pos = 1, parse = check_cube, @@ -717,7 +734,7 @@ worldedit.register_command("cube", { end, func = function(name, w, h, l, node) local count = worldedit.cube(worldedit.pos1[name], w, h, l, node) - worldedit.player_notify(name, count .. " nodes added") + worldedit.player_notify(name, S("@1 nodes added", count)) end, }) @@ -728,14 +745,14 @@ local check_sphere = function(param) end local node = worldedit.normalize_nodename(nodename) if not node then - return false, "invalid node name: " .. nodename + return false, S("invalid node name: @1", nodename) end return true, tonumber(radius), node end worldedit.register_command("hollowsphere", { params = " ", - description = "Add hollow sphere centered at WorldEdit position 1 with radius , composed of ", + description = S("Add hollow sphere centered at WorldEdit position 1 with radius , composed of "), privs = {worldedit=true}, require_pos = 1, parse = check_sphere, @@ -744,13 +761,13 @@ worldedit.register_command("hollowsphere", { end, func = function(name, radius, node) local count = worldedit.sphere(worldedit.pos1[name], radius, node, true) - worldedit.player_notify(name, count .. " nodes added") + worldedit.player_notify(name, S("@1 nodes added", count)) end, }) worldedit.register_command("sphere", { params = " ", - description = "Add sphere centered at WorldEdit position 1 with radius , composed of ", + description = S("Add sphere centered at WorldEdit position 1 with radius , composed of "), privs = {worldedit=true}, require_pos = 1, parse = check_sphere, @@ -759,7 +776,7 @@ worldedit.register_command("sphere", { end, func = function(name, radius, node) local count = worldedit.sphere(worldedit.pos1[name], radius, node) - worldedit.player_notify(name, count .. " nodes added") + worldedit.player_notify(name, S("@1 nodes added", count)) end, }) @@ -770,14 +787,14 @@ local check_dome = function(param) end local node = worldedit.normalize_nodename(nodename) if not node then - return false, "invalid node name: " .. nodename + return false, S("invalid node name: @1", nodename) end return true, tonumber(radius), node end worldedit.register_command("hollowdome", { params = " ", - description = "Add hollow dome centered at WorldEdit position 1 with radius , composed of ", + description = S("Add hollow dome centered at WorldEdit position 1 with radius , composed of "), privs = {worldedit=true}, require_pos = 1, parse = check_dome, @@ -786,13 +803,13 @@ worldedit.register_command("hollowdome", { end, func = function(name, radius, node) local count = worldedit.dome(worldedit.pos1[name], radius, node, true) - worldedit.player_notify(name, count .. " nodes added") + worldedit.player_notify(name, S("@1 nodes added", count)) end, }) worldedit.register_command("dome", { params = " ", - description = "Add dome centered at WorldEdit position 1 with radius , composed of ", + description = S("Add dome centered at WorldEdit position 1 with radius , composed of "), privs = {worldedit=true}, require_pos = 1, parse = check_dome, @@ -801,7 +818,7 @@ worldedit.register_command("dome", { end, func = function(name, radius, node) local count = worldedit.dome(worldedit.pos1[name], radius, node) - worldedit.player_notify(name, count .. " nodes added") + worldedit.player_notify(name, S("@1 nodes added", count)) end, }) @@ -818,14 +835,14 @@ local check_cylinder = function(param) end local node = worldedit.normalize_nodename(nodename) if not node then - return false, "invalid node name: " .. nodename + return false, S("invalid node name: @1", nodename) end return true, axis, tonumber(length), tonumber(radius1), tonumber(radius2), node end worldedit.register_command("hollowcylinder", { params = "x/y/z/? [radius2] ", - description = "Add hollow cylinder at WorldEdit position 1 along the given axis with length , base radius (and top radius [radius2]), composed of ", + description = S("Add hollow cylinder at WorldEdit position 1 along the given axis with length , base radius (and top radius [radius2]), composed of "), privs = {worldedit=true}, require_pos = 1, parse = check_cylinder, @@ -840,13 +857,13 @@ worldedit.register_command("hollowcylinder", { length = length * sign end local count = worldedit.cylinder(worldedit.pos1[name], axis, length, radius1, radius2, node, true) - worldedit.player_notify(name, count .. " nodes added") + worldedit.player_notify(name, S("@1 nodes added", count)) end, }) worldedit.register_command("cylinder", { params = "x/y/z/? [radius2] ", - description = "Add cylinder at WorldEdit position 1 along the given axis with length , base radius (and top radius [radius2]), composed of ", + description = S("Add cylinder at WorldEdit position 1 along the given axis with length , base radius (and top radius [radius2]), composed of "), privs = {worldedit=true}, require_pos = 1, parse = check_cylinder, @@ -861,7 +878,7 @@ worldedit.register_command("cylinder", { length = length * sign end local count = worldedit.cylinder(worldedit.pos1[name], axis, length, radius1, radius2, node) - worldedit.player_notify(name, count .. " nodes added") + worldedit.player_notify(name, S("@1 nodes added", count)) end, }) @@ -872,14 +889,14 @@ local check_pyramid = function(param) end local node = worldedit.normalize_nodename(nodename) if not node then - return false, "invalid node name: " .. nodename + return false, S("invalid node name: @1", nodename) end return true, axis, tonumber(height), node end worldedit.register_command("hollowpyramid", { params = "x/y/z/? ", - description = "Add hollow pyramid centered at WorldEdit position 1 along the given axis with height , composed of ", + description = S("Add hollow pyramid centered at WorldEdit position 1 along the given axis with height , composed of "), privs = {worldedit=true}, require_pos = 1, parse = check_pyramid, @@ -893,13 +910,13 @@ worldedit.register_command("hollowpyramid", { height = height * sign end local count = worldedit.pyramid(worldedit.pos1[name], axis, height, node, true) - worldedit.player_notify(name, count .. " nodes added") + worldedit.player_notify(name, S("@1 nodes added", count)) end, }) worldedit.register_command("pyramid", { params = "x/y/z/? ", - description = "Add pyramid centered at WorldEdit position 1 along the given axis with height , composed of ", + description = S("Add pyramid centered at WorldEdit position 1 along the given axis with height , composed of "), privs = {worldedit=true}, require_pos = 1, parse = check_pyramid, @@ -913,13 +930,13 @@ worldedit.register_command("pyramid", { height = height * sign end local count = worldedit.pyramid(worldedit.pos1[name], axis, height, node) - worldedit.player_notify(name, count .. " nodes added") + worldedit.player_notify(name, S("@1 nodes added", count)) end, }) worldedit.register_command("spiral", { params = " ", - description = "Add spiral centered at WorldEdit position 1 with side length , height , space between walls , composed of ", + description = S("Add spiral centered at WorldEdit position 1 with side length , height , space between walls , composed of "), privs = {worldedit=true}, require_pos = 1, parse = function(param) @@ -929,7 +946,7 @@ worldedit.register_command("spiral", { end local node = worldedit.normalize_nodename(nodename) if not node then - return false, "invalid node name: " .. nodename + return false, S("invalid node name: @1", nodename) end return true, tonumber(length), tonumber(height), tonumber(space), node end, @@ -938,13 +955,13 @@ worldedit.register_command("spiral", { end, func = function(name, length, height, space, node) local count = worldedit.spiral(worldedit.pos1[name], length, height, space, node) - worldedit.player_notify(name, count .. " nodes added") + worldedit.player_notify(name, S("@1 nodes added", count)) end, }) worldedit.register_command("copy", { params = "x/y/z/? ", - description = "Copy the current WorldEdit region along the given axis by nodes", + description = S("Copy the current WorldEdit region along the given axis by nodes"), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -965,13 +982,13 @@ worldedit.register_command("copy", { end local count = worldedit.copy(worldedit.pos1[name], worldedit.pos2[name], axis, amount) - worldedit.player_notify(name, count .. " nodes copied") + worldedit.player_notify(name, S("@1 nodes copied", count)) end, }) worldedit.register_command("move", { params = "x/y/z/? ", - description = "Move the current WorldEdit region along the given axis by nodes", + description = S("Move the current WorldEdit region along the given axis by nodes"), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -997,13 +1014,13 @@ worldedit.register_command("move", { pos1[axis] = pos1[axis] + amount pos2[axis] = pos2[axis] + amount worldedit.marker_update(name) - worldedit.player_notify(name, count .. " nodes moved") + worldedit.player_notify(name, S("@1 nodes moved", count)) end, }) worldedit.register_command("stack", { params = "x/y/z/? ", - description = "Stack the current WorldEdit region along the given axis times", + description = S("Stack the current WorldEdit region along the given axis times"), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -1026,24 +1043,24 @@ worldedit.register_command("stack", { local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] local count = worldedit.volume(pos1, pos2) * math.abs(repetitions) worldedit.stack(pos1, pos2, axis, repetitions, function() - worldedit.player_notify(name, count .. " nodes stacked") + worldedit.player_notify(name, S("@1 nodes stacked", count)) end) end, }) worldedit.register_command("stack2", { params = " ", - description = "Stack the current WorldEdit region times by offset , , ", + description = S("Stack the current WorldEdit region times by offset , , "), privs = {worldedit=true}, require_pos = 2, parse = function(param) local repetitions, incs = param:match("(%d+)%s*(.+)") if repetitions == nil then - return false, "invalid count: " .. param + return false, S("invalid count: @1", param) end local x, y, z = incs:match("([+-]?%d+) ([+-]?%d+) ([+-]?%d+)") if x == nil then - return false, "invalid increments: " .. param + return false, S("invalid increments: @1", param) end return true, tonumber(repetitions), vector.new(tonumber(x), tonumber(y), tonumber(z)) @@ -1055,7 +1072,7 @@ worldedit.register_command("stack2", { local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] local count = worldedit.volume(pos1, pos2) * repetitions worldedit.stack2(pos1, pos2, offset, repetitions, function() - worldedit.player_notify(name, count .. " nodes stacked") + worldedit.player_notify(name, S("@1 nodes stacked", count)) end) end, }) @@ -1063,7 +1080,7 @@ worldedit.register_command("stack2", { worldedit.register_command("stretch", { params = " ", - description = "Scale the current WorldEdit positions and region by a factor of , , along the X, Y, and Z axes, repectively, with position 1 as the origin", + description = S("Scale the current WorldEdit positions and region by a factor of , , along the X, Y, and Z axes, repectively, with position 1 as the origin"), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -1073,7 +1090,7 @@ worldedit.register_command("stretch", { end stretchx, stretchy, stretchz = tonumber(stretchx), tonumber(stretchy), tonumber(stretchz) if stretchx == 0 or stretchy == 0 or stretchz == 0 then - return false, "invalid scaling factors: " .. param + return false, S("invalid scaling factors: @1", param) end return true, stretchx, stretchy, stretchz end, @@ -1089,13 +1106,13 @@ worldedit.register_command("stretch", { worldedit.pos2[name] = pos2 worldedit.marker_update(name) - worldedit.player_notify(name, count .. " nodes stretched") + worldedit.player_notify(name, S("@1 nodes stretched", count)) end, }) worldedit.register_command("transpose", { params = "x/y/z/? x/y/z/?", - description = "Transpose the current WorldEdit region along the given axes", + description = S("Transpose the current WorldEdit region along the given axes"), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -1103,7 +1120,7 @@ worldedit.register_command("transpose", { if found == nil then return false elseif axis1 == axis2 then - return false, "invalid usage: axes must be different" + return false, S("invalid usage: axes must be different") end return true, axis1, axis2 end, @@ -1119,13 +1136,13 @@ worldedit.register_command("transpose", { worldedit.pos2[name] = pos2 worldedit.marker_update(name) - worldedit.player_notify(name, count .. " nodes transposed") + worldedit.player_notify(name, S("@1 nodes transposed", count)) end, }) worldedit.register_command("flip", { params = "x/y/z/?", - description = "Flip the current WorldEdit region along the given axis", + description = S("Flip the current WorldEdit region along the given axis"), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -1138,13 +1155,13 @@ worldedit.register_command("flip", { func = function(name, param) if param == "?" then param = worldedit.player_axis(name) end local count = worldedit.flip(worldedit.pos1[name], worldedit.pos2[name], param) - worldedit.player_notify(name, count .. " nodes flipped") + worldedit.player_notify(name, S("@1 nodes flipped", count)) end, }) worldedit.register_command("rotate", { params = "x/y/z/? ", - description = "Rotate the current WorldEdit region around the given axis by angle (90 degree increment)", + description = S("Rotate the current WorldEdit region around the given axis by angle (90 degree increment)"), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -1154,7 +1171,7 @@ worldedit.register_command("rotate", { end angle = tonumber(angle) if angle % 90 ~= 0 or angle % 360 == 0 then - return false, "invalid usage: angle must be multiple of 90" + return false, S("invalid usage: angle must be multiple of 90") end return true, axis, angle end, @@ -1169,13 +1186,13 @@ worldedit.register_command("rotate", { worldedit.pos2[name] = pos2 worldedit.marker_update(name) - worldedit.player_notify(name, count .. " nodes rotated") + worldedit.player_notify(name, S("@1 nodes rotated", count)) end, }) worldedit.register_command("orient", { params = "", - description = "Rotate oriented nodes in the current WorldEdit region around the Y axis by angle (90 degree increment)", + description = S("Rotate oriented nodes in the current WorldEdit region around the Y axis by angle (90 degree increment)"), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -1185,32 +1202,32 @@ worldedit.register_command("orient", { end angle = tonumber(angle) if angle % 90 ~= 0 then - return false, "invalid usage: angle must be multiple of 90" + return false, S("invalid usage: angle must be multiple of 90") end return true, angle end, nodes_needed = check_region, func = function(name, angle) local count = worldedit.orient(worldedit.pos1[name], worldedit.pos2[name], angle) - worldedit.player_notify(name, count .. " nodes oriented") + worldedit.player_notify(name, S("@1 nodes oriented", count)) end, }) worldedit.register_command("fixlight", { params = "", - description = "Fix the lighting in the current WorldEdit region", + description = S("Fix the lighting in the current WorldEdit region"), privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, func = function(name) local count = worldedit.fixlight(worldedit.pos1[name], worldedit.pos2[name]) - worldedit.player_notify(name, count .. " nodes updated") + worldedit.player_notify(name, S("@1 nodes updated", count)) end, }) worldedit.register_command("drain", { params = "", - description = "Remove any fluid node within the current WorldEdit region", + description = S("Remove any fluid node within the current WorldEdit region"), privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, @@ -1233,7 +1250,7 @@ worldedit.register_command("drain", { end end end - worldedit.player_notify(name, count .. " nodes updated") + worldedit.player_notify(name, S("@1 nodes updated", count)) end, }) @@ -1308,76 +1325,76 @@ end worldedit.register_command("clearcut", { params = "", - description = "Remove any plant, tree or foilage-like nodes in the selected region", + description = S("Remove any plant, tree or foliage-like nodes in the selected region"), privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, func = function(name) local pos1, pos2 = worldedit.sort_pos(worldedit.pos1[name], worldedit.pos2[name]) local count = clearcut(pos1, pos2) - worldedit.player_notify(name, count .. " nodes removed") + worldedit.player_notify(name, S("@1 nodes removed", count)) end, }) worldedit.register_command("hide", { params = "", - description = "Hide all nodes in the current WorldEdit region non-destructively", + description = S("Hide all nodes in the current WorldEdit region non-destructively"), privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, func = function(name) local count = worldedit.hide(worldedit.pos1[name], worldedit.pos2[name]) - worldedit.player_notify(name, count .. " nodes hidden") + worldedit.player_notify(name, S("@1 nodes hidden", count)) end, }) worldedit.register_command("suppress", { params = "", - description = "Suppress all in the current WorldEdit region non-destructively", + description = S("Suppress all in the current WorldEdit region non-destructively"), privs = {worldedit=true}, require_pos = 2, parse = function(param) local node = worldedit.normalize_nodename(param) if not node then - return false, "invalid node name: " .. param + return false, S("invalid node name: @1", param) end return true, node end, nodes_needed = check_region, func = function(name, node) local count = worldedit.suppress(worldedit.pos1[name], worldedit.pos2[name], node) - worldedit.player_notify(name, count .. " nodes suppressed") + worldedit.player_notify(name, S("@1 nodes suppressed", count)) end, }) worldedit.register_command("highlight", { params = "", - description = "Highlight in the current WorldEdit region by hiding everything else non-destructively", + description = S("Highlight in the current WorldEdit region by hiding everything else non-destructively"), privs = {worldedit=true}, require_pos = 2, parse = function(param) local node = worldedit.normalize_nodename(param) if not node then - return false, "invalid node name: " .. param + return false, S("invalid node name: @1", param) end return true, node end, nodes_needed = check_region, func = function(name, node) local count = worldedit.highlight(worldedit.pos1[name], worldedit.pos2[name], node) - worldedit.player_notify(name, count .. " nodes highlighted") + worldedit.player_notify(name, S("@1 nodes highlighted", count)) end, }) worldedit.register_command("restore", { params = "", - description = "Restores nodes hidden with WorldEdit in the current WorldEdit region", + description = S("Restores nodes hidden with WorldEdit in the current WorldEdit region"), privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, func = function(name) local count = worldedit.restore(worldedit.pos1[name], worldedit.pos2[name]) - worldedit.player_notify(name, count .. " nodes restored") + worldedit.player_notify(name, S("@1 nodes restored", count)) end, }) @@ -1391,16 +1408,16 @@ local function detect_misaligned_schematic(name, pos1, pos2) local have_node_at_origin = node.name ~= "air" and node.name ~= "ignore" if not have_node_at_origin then worldedit.player_notify(name, - "Warning: The schematic contains excessive free space and WILL be ".. + S("Warning: The schematic contains excessive free space and WILL be ".. "misaligned when allocated or loaded. To avoid this, shrink your ".. - "area to cover exactly the nodes to be saved." + "area to cover exactly the nodes to be saved.") ) end end worldedit.register_command("save", { params = "", - description = "Save the current WorldEdit region to \"(world folder)/schems/.we\"", + description = S("Save the current WorldEdit region to \"(world folder)/schems/.we\""), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -1408,7 +1425,7 @@ worldedit.register_command("save", { return false end if not check_filename(param) then - return false, "Disallowed file name: " .. param + return false, S("Disallowed file name: @1", param) end return true, param end, @@ -1425,20 +1442,20 @@ worldedit.register_command("save", { local filename = path .. "/" .. param .. ".we" local file, err = io.open(filename, "wb") if err ~= nil then - worldedit.player_notify(name, "Could not save file to \"" .. filename .. "\"") + worldedit.player_notify(name, S("Could not save file to \"@1\"", filename)) return end file:write(result) file:flush() file:close() - worldedit.player_notify(name, count .. " nodes saved") + worldedit.player_notify(name, S("@1 nodes saved", count)) end, }) worldedit.register_command("allocate", { params = "", - description = "Set the region defined by nodes from \"(world folder)/schems/.we\" as the current WorldEdit region", + description = S("Set the region defined by nodes from \"(world folder)/schems/.we\" as the current WorldEdit region"), privs = {worldedit=true}, require_pos = 1, parse = function(param) @@ -1446,7 +1463,7 @@ worldedit.register_command("allocate", { return false end if not check_filename(param) then - return false, "Disallowed file name: " .. param + return false, S("Disallowed file name: @1", param) end return true, param end, @@ -1460,7 +1477,7 @@ worldedit.register_command("allocate", { local nodepos1, nodepos2, count = worldedit.allocate(pos, value) if not nodepos1 then - worldedit.player_notify(name, "Schematic empty, nothing allocated") + worldedit.player_notify(name, S("Schematic empty, nothing allocated")) return false end @@ -1468,13 +1485,13 @@ worldedit.register_command("allocate", { worldedit.pos2[name] = nodepos2 worldedit.marker_update(name) - worldedit.player_notify(name, count .. " nodes allocated") + worldedit.player_notify(name, S("@1 nodes allocated", count)) end, }) worldedit.register_command("load", { params = "", - description = "Load nodes from \"(world folder)/schems/[.we[m]]\" with position 1 of the current WorldEdit region as the origin", + description = S("Load nodes from \"(world folder)/schems/[.we[m]]\" with position 1 of the current WorldEdit region as the origin"), privs = {worldedit=true}, require_pos = 1, parse = function(param) @@ -1482,7 +1499,7 @@ worldedit.register_command("load", { return false end if not check_filename(param) then - return false, "Disallowed file name: " .. param + return false, S("Disallowed file name: @1", param) end return true, param end, @@ -1496,16 +1513,16 @@ worldedit.register_command("load", { local count = worldedit.deserialize(pos, value) if count == nil then - worldedit.player_notify(name, "Loading failed!") + worldedit.player_notify(name, S("Loading failed!")) return false end - worldedit.player_notify(name, count .. " nodes loaded") + worldedit.player_notify(name, S("@1 nodes loaded", count)) end, }) worldedit.register_command("lua", { params = "", - description = "Executes as a Lua chunk in the global namespace", + description = S("Executes as a Lua chunk in the global namespace"), privs = {worldedit=true, server=true}, parse = function(param) return true, param @@ -1524,7 +1541,7 @@ worldedit.register_command("lua", { worldedit.register_command("luatransform", { params = "", - description = "Executes as a Lua chunk in the global namespace with the variable pos available, for each node in the current WorldEdit region", + description = S("Executes as a Lua chunk in the global namespace with the variable pos available, for each node in the current WorldEdit region"), privs = {worldedit=true, server=true}, require_pos = 2, parse = function(param) @@ -1545,8 +1562,8 @@ worldedit.register_command("luatransform", { worldedit.register_command("mtschemcreate", { params = "", - description = "Save the current WorldEdit region using the Minetest ".. - "Schematic format to \"(world folder)/schems/.mts\"", + description = S("Save the current WorldEdit region using the Minetest ".. + "Schematic format to \"(world folder)/schems/.mts\""), privs = {worldedit=true}, require_pos = 2, parse = function(param) @@ -1554,7 +1571,7 @@ worldedit.register_command("mtschemcreate", { return false end if not check_filename(param) then - return false, "Disallowed file name: " .. param + return false, S("Disallowed file name: @1", param) end return true, param end, @@ -1569,9 +1586,9 @@ worldedit.register_command("mtschemcreate", { worldedit.pos2[name], worldedit.prob_list[name], filename) if ret == nil then - worldedit.player_notify(name, "Failed to create Minetest schematic") + worldedit.player_notify(name, S("Failed to create Minetest schematic")) else - worldedit.player_notify(name, "Saved Minetest schematic to " .. param) + worldedit.player_notify(name, S("Saved Minetest schematic to @1", param)) end worldedit.prob_list[name] = {} end, @@ -1579,7 +1596,7 @@ worldedit.register_command("mtschemcreate", { worldedit.register_command("mtschemplace", { params = "", - description = "Load nodes from \"(world folder)/schems/.mts\" with position 1 of the current WorldEdit region as the origin", + description = S("Load nodes from \"(world folder)/schems/.mts\" with position 1 of the current WorldEdit region as the origin"), privs = {worldedit=true}, require_pos = 1, parse = function(param) @@ -1587,7 +1604,7 @@ worldedit.register_command("mtschemplace", { return false end if not check_filename(param) then - return false, "Disallowed file name: " .. param + return false, S("Disallowed file name: @1", param) end return true, param end, @@ -1596,21 +1613,20 @@ worldedit.register_command("mtschemplace", { local path = minetest.get_worldpath() .. "/schems/" .. param .. ".mts" if minetest.place_schematic(pos, path) == nil then - worldedit.player_notify(name, "failed to place Minetest schematic") + worldedit.player_notify(name, S("failed to place Minetest schematic")) else - worldedit.player_notify(name, "placed Minetest schematic " .. param .. - " at " .. minetest.pos_to_string(pos)) + worldedit.player_notify(name, S("placed Minetest schematic @1 at @2", param, minetest.pos_to_string(pos))) end end, }) worldedit.register_command("mtschemprob", { params = "start/finish/get", - description = "Begins node probability entry for Minetest schematics, gets the nodes that have probabilities set, or ends node probability entry", + description = S("Begins node probability entry for Minetest schematics, gets the nodes that have probabilities set, or ends node probability entry"), privs = {worldedit=true}, parse = function(param) if param ~= "start" and param ~= "finish" and param ~= "get" then - return false, "unknown subcommand: " .. param + return false, S("unknown subcommand: @1", param) end return true, param end, @@ -1618,10 +1634,10 @@ worldedit.register_command("mtschemprob", { if param == "start" then --start probability setting worldedit.set_pos[name] = "prob" worldedit.prob_list[name] = {} - worldedit.player_notify(name, "select Minetest schematic probability values by punching nodes") + worldedit.player_notify(name, S("select Minetest schematic probability values by punching nodes")) elseif param == "finish" then --finish probability setting worldedit.set_pos[name] = nil - worldedit.player_notify(name, "finished Minetest schematic probability selection") + worldedit.player_notify(name, S("finished Minetest schematic probability selection")) elseif param == "get" then --get all nodes that had probabilities set on them local text = "" local problist = worldedit.prob_list[name] @@ -1632,7 +1648,7 @@ worldedit.register_command("mtschemprob", { local prob = math.floor(((v.prob / 256) * 100) * 100 + 0.5) / 100 text = text .. minetest.pos_to_string(v.pos) .. ": " .. prob .. "% | " end - worldedit.player_notify(name, "currently set node probabilities:") + worldedit.player_notify(name, S("currently set node probabilities:")) worldedit.player_notify(name, text) end end, @@ -1647,7 +1663,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end local e = {pos=worldedit.prob_pos[name], prob=tonumber(fields.text)} if e.pos == nil or e.prob == nil or e.prob < 0 or e.prob > 256 then - worldedit.player_notify(name, "invalid node probability given, not saved") + worldedit.player_notify(name, S("invalid node probability given, not saved")) return end problist[#problist+1] = e @@ -1656,12 +1672,12 @@ end) worldedit.register_command("clearobjects", { params = "", - description = "Clears all objects within the WorldEdit region", + description = S("Clears all objects within the WorldEdit region"), privs = {worldedit=true}, require_pos = 2, nodes_needed = check_region, func = function(name) local count = worldedit.clear_objects(worldedit.pos1[name], worldedit.pos2[name]) - worldedit.player_notify(name, count .. " objects cleared") + worldedit.player_notify(name, S("@1 objects cleared", count)) end, }) diff --git a/worldedit_commands/locale/template.txt b/worldedit_commands/locale/template.txt new file mode 100644 index 0000000..d9a40a8 --- /dev/null +++ b/worldedit_commands/locale/template.txt @@ -0,0 +1,155 @@ +# textdomain: worldedit_commands + +### init.lua ### +Can use WorldEdit commands= + +no region selected= +no position 1 selected= +invalid usage= +Could not open file "@1"= +Invalid file format!= +Schematic was created with a newer version of WorldEdit.= + +Get information about the WorldEdit mod= +WorldEdit @1 is available on this server. Type //help to get a list of commands, or get more information at @2= +Get help for WorldEdit commands= +You are not allowed to use any WorldEdit commands.= +Available commands: @1@nUse '//help ' to get more information, or '//help all' to list everything.= +Available commands:@n= +Command not available: = +Enable or disable node inspection= +inspector: inspection enabled for @1, currently facing the @2 axis= +inspector: inspection disabled= +inspector: @1 at @2 (param1=@3, param2=@4, received light=@5) punched facing the @6 axis=inspector: @1 в @2 (param1=@3, param2=@4, received light= +Reset the region so that it is empty= +region reset= +Show markers at the region positions= +region marked= +Hide markers if currently shown= +region unmarked= +Set WorldEdit region position @1 to the player's location= +Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching nodes, or display the current WorldEdit region= +unknown subcommand: @1= +select positions by punching two nodes= +select position @1 by punching a node= +position @1: @2= +position @1 not set= +Set a WorldEdit region position to the position at (, , )= +position @1 set to @2= +Display the volume of the current WorldEdit region= +current region has a volume of @1 nodes (@2*@3*@4)= +Remove all MapBlocks (16x16x16) containing the selected area from the map= +Area deleted.= +There was an error during deletion of the area.= +Set the current WorldEdit region to = +invalid node name: @1= +@1 nodes set= +Set param2 of all nodes in the current WorldEdit region to = +Param2 is out of range (must be between 0 and 255 inclusive!)= +@1 nodes altered= +Fill the current WorldEdit region with a random mix of , ...= +invalid search node name: @1= +invalid replace node name: @1= +Replace all instances of with in the current WorldEdit region= +@1 nodes replaced= +Replace all nodes other than with in the current WorldEdit region= +Add a hollow cube with its ground level centered at WorldEdit position 1 with dimensions x x , composed of .= +@1 nodes added= +Add a cube with its ground level centered at WorldEdit position 1 with dimensions x x , composed of .= +Add hollow sphere centered at WorldEdit position 1 with radius , composed of = +Add sphere centered at WorldEdit position 1 with radius , composed of = +Add hollow dome centered at WorldEdit position 1 with radius , composed of = +Add dome centered at WorldEdit position 1 with radius , composed of = +Add hollow cylinder at WorldEdit position 1 along the given axis with length , base radius (and top radius [radius2]), composed of = +Add cylinder at WorldEdit position 1 along the given axis with length , base radius (and top radius [radius2]), composed of = +Add hollow pyramid centered at WorldEdit position 1 along the given axis with height , composed of = +Add pyramid centered at WorldEdit position 1 along the given axis with height , composed of = +Add spiral centered at WorldEdit position 1 with side length , height , space between walls , composed of = +Copy the current WorldEdit region along the given axis by nodes= +@1 nodes copied= +Move the current WorldEdit region along the given axis by nodes= +@1 nodes moved= +Stack the current WorldEdit region along the given axis times= +@1 nodes stacked= +Stack the current WorldEdit region times by offset , , = +invalid count: @1= +invalid increments: @1= +Scale the current WorldEdit positions and region by a factor of , , along the X, Y, and Z axes, repectively, with position 1 as the origin= +invalid scaling factors: @1= +@1 nodes stretched= +Transpose the current WorldEdit region along the given axes= +invalid usage: axes must be different= +@1 nodes transposed= +Flip the current WorldEdit region along the given axis= +@1 nodes flipped= +Rotate the current WorldEdit region around the given axis by angle (90 degree increment)= +invalid usage: angle must be multiple of 90= +@1 nodes rotated= +Rotate oriented nodes in the current WorldEdit region around the Y axis by angle (90 degree increment)= +@1 nodes oriented= +Fix the lighting in the current WorldEdit region= +@1 nodes updated= +Remove any fluid node within the current WorldEdit region= +Remove any plant, tree or foliage-like nodes in the selected region= +@1 nodes removed= +Hide all nodes in the current WorldEdit region non-destructively= +@1 nodes hidden= +Suppress all in the current WorldEdit region non-destructively= +@1 nodes suppressed= +Highlight in the current WorldEdit region by hiding everything else non-destructively= +@1 nodes highlighted= +Restores nodes hidden with WorldEdit in the current WorldEdit region= +@1 nodes restored= +Warning: The schematic contains excessive free space and WILL be misaligned when allocated or loaded. To avoid this, shrink your area to cover exactly the nodes to be saved.= +Save the current WorldEdit region to "(world folder)/schems/.we"= +Disallowed file name: @1= +Could not save file to "@1"= +@1 nodes saved= +Set the region defined by nodes from "(world folder)/schems/.we" as the current WorldEdit region= +Schematic empty, nothing allocated= +@1 nodes allocated= +Load nodes from "(world folder)/schems/[.we[m]]" with position 1 of the current WorldEdit region as the origin= +Loading failed!= +@1 nodes loaded= +Executes as a Lua chunk in the global namespace= +Executes as a Lua chunk in the global namespace with the variable pos available, for each node in the current WorldEdit region= +Save the current WorldEdit region using the Minetest Schematic format to "(world folder)/schems/.mts"= +Failed to create Minetest schematic= +Saved Minetest schematic to @1= +Load nodes from "(world folder)/schems/.mts" with position 1 of the current WorldEdit region as the origin= +failed to place Minetest schematic= +placed Minetest schematic @1 at @2= +Begins node probability entry for Minetest schematics, gets the nodes that have probabilities set, or ends node probability entry= +select Minetest schematic probability values by punching nodes= +finished Minetest schematic probability selection= +currently set node probabilities:= +invalid node probability given, not saved= +Clears all objects within the WorldEdit region= +@1 objects cleared= + +### safe.lua ### +WARNING: this operation could affect up to @1 nodes; type //y to continue or //n to cancel= +Confirm a pending operation= +no operation pending= +Abort a pending operation= + +### cuboid.lua ### +Outset the selected region.= +Invalid direction: @1= +Invalid number of arguments= +Region outset by @1 nodes= +Inset the selected region.= +Region inset by @1 nodes= +Shifts the selection area without moving its contents= +Invalid if looking straight up or down= +Region shifted by @1 nodes= +Expands the selection in the selected absolute or relative axis= +Region expanded by @1 nodes= +Contracts the selection in the selected absolute or relative axis= +Region contracted by @1 nodes= +Select a cube with side length around position 1 and run on region= +invalid usage: //@1 cannot be used with cubeapply= +Missing privileges: @1= + +### wand.lua ### +WorldEdit Wand tool@\nLeft-click to set 1st position, right-click to set 2nd= diff --git a/worldedit_commands/locale/worldedit_command.ru.tr b/worldedit_commands/locale/worldedit_command.ru.tr new file mode 100644 index 0000000..9c86b08 --- /dev/null +++ b/worldedit_commands/locale/worldedit_command.ru.tr @@ -0,0 +1,155 @@ +# textdomain: worldedit_commands + +### init.lua ### +Can use WorldEdit commands=Возможность редактировать мир с помощью команд WorldEdit + +no region selected=не выделен регион +no position 1 selected=не установлена позиция региона 1 +invalid usage=не верное использование команды +Could not open file "@1"=Не удаётся открыть файл "@1" +Invalid file format!=Не верный формат файла! +Schematic was created with a newer version of WorldEdit.=Схема была создана с использованием более новой версии WorldEdit. + +Get information about the WorldEdit mod=Вывести информацию о WorldEdit +WorldEdit @1 is available on this server. Type //help to get a list of commands, or get more information at @2=WorldEdit @1 доступен на этом сервере. Наберите команду //help чтобы увидеть список команд, больше информации по ссылке @2 +Get help for WorldEdit commands=Вывести информацию об использовании команд WorldEdit +You are not allowed to use any WorldEdit commands.=У вас нет привилегий, чтобы использовать команды WorldEdit. +Available commands: @1@nUse '//help ' to get more information, or '//help all' to list everything.=Доступные команды: @1@nИспользуйте '//help ' для получения информации по команде или '//help all' для вывода подсказок по всем командам. +Available commands:@n=Доступные команды:@n +Command not available: =Команда не найдена: +Enable or disable node inspection=Включить/отключить инспекцию блоков +inspector: inspection enabled for @1, currently facing the @2 axis=inspector: инспекция включена для @1, текущий взор в направлении оси @2 +inspector: inspection disabled=inspector: инспекция отключена +inspector: @1 at @2 (param1=@3, param2=@4, received light=@5) punched facing the @6 axis=inspector: @1 в @2 (param1=@3, param2=@4, received light=@5) ударен по поверхности @6 +Reset the region so that it is empty=Сбросить выделение области +region reset=регион сброшен +Show markers at the region positions=Отобразить маркеры выделенной области +region marked=маркеры отображены +Hide markers if currently shown=Скрыть маркеры выделенной области +region unmarked=маркеры скрыты +Set WorldEdit region position @1 to the player's location=Установить маркер @1 для WorldEdit-региона в месте нахождения игрока +Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching nodes, or display the current WorldEdit region=Выделить WorldEdit-регион или установить маркеры для WorldEdit-региона, либо отобразить уже выбранную область +unknown subcommand: @1=неизвестная подкоманда: @1 +select positions by punching two nodes=выберите позиции, ударив по блокам +select position @1 by punching a node=выберите позицию @1, ударив по блоку +position @1: @2=позиция @1: @2 +position @1 not set=позиция @1 не установлена +Set a WorldEdit region position to the position at (, , )=Установить маркер для WorldEdit в позиции (, , ) +position @1 set to @2=позиция @1 установлена в @2 +Display the volume of the current WorldEdit region=Вывести информацию об объёме текущей выделенной области WorldEdit (кол-во нод, размеры) +current region has a volume of @1 nodes (@2*@3*@4)=текущий регион имеет объем @1 нод (@2*@3*@4) +Remove all MapBlocks (16x16x16) containing the selected area from the map=Удалить MapBlocks (16x16x16), содержащие выбранную область +Area deleted.=Область удалена. +There was an error during deletion of the area.=Что-то пошло не так при удалении области. +Set the current WorldEdit region to =Заполнить выбранный WorldEdit-регион указанным типом блоков +invalid node name: @1=неверное название блока: @1 +@1 nodes set=@1 блок(а/ов) установленно +Set param2 of all nodes in the current WorldEdit region to =Проставить param2 для всех блоков в текущем WorldEdit-регионе +Param2 is out of range (must be between 0 and 255 inclusive!)=Значение param2 должно быть от 0 до 255 (включительно!) +@1 nodes altered=изменено @1 блок(а/ов) +Fill the current WorldEdit region with a random mix of , ...=Заполнить выбранный WorldEdit-регион смесью указанных типов блоков +invalid search node name: @1=неверное название блока-поиска: @1 +invalid replace node name: @1=неверное название блока-замены: @1 +Replace all instances of with in the current WorldEdit region=Заменить все блоки на в выбранной WorldEdit-области +@1 nodes replaced=заменено @1 нод(а/ы) +Replace all nodes other than with in the current WorldEdit region=Заменить все блоки, кроме , на в выбранной WorldEdit-области +Add a hollow cube with its ground level centered at WorldEdit position 1 with dimensions x x , composed of .=Установить полый куб с центром нижней грани в позиции 1 и указанными размерами, состоящий из блоков . +@1 nodes added=добавлен(о) @1 блок(а/ов) +Add a cube with its ground level centered at WorldEdit position 1 with dimensions x x , composed of .=Установить куб с центром нижней грани в позиции 1 и указанными размерами, состоящий из блоков . +Add hollow sphere centered at WorldEdit position 1 with radius , composed of =Установить полую сферу с центром в WorldEdit-позиции 1 радиусом , состоящую из блоков +Add sphere centered at WorldEdit position 1 with radius , composed of =Установить сферу с центром в WorldEdit-позиции 1 радиусом , состоящую из блоков +Add hollow dome centered at WorldEdit position 1 with radius , composed of =Установить полый купол с центром в WorldEdit-позиции 1 радиусом , состоящий из блоков +Add dome centered at WorldEdit position 1 with radius , composed of =Установить купол с центром в WorldEdit-позиции 1 радиусом , состоящий из блоков +Add hollow cylinder at WorldEdit position 1 along the given axis with length , base radius (and top radius [radius2]), composed of =Установить полый цилиндр вдоль указанной оси, с центром в позиции 1, высотой/длинной , с радиусом основания (и радиусом вершины [radius 2]), состоящий из блоков +Add cylinder at WorldEdit position 1 along the given axis with length , base radius (and top radius [radius2]), composed of =Установить цилиндр вдоль указанной оси, с центром в позиции 1, высотой/длинной , с радиусом основания (и радиусом вершины [radius 2]), состоящий из блоков +Add hollow pyramid centered at WorldEdit position 1 along the given axis with height , composed of =Установить полую пирамиду вдоль указанной оси, с центром в WorldEdit-позиции 1 высотой , состоящую из блоков +Add pyramid centered at WorldEdit position 1 along the given axis with height , composed of =Установить пирамиду вдоль указанной оси, с центром в WorldEdit-позиции 1 высотой , состоящую из блоков +Add spiral centered at WorldEdit position 1 with side length , height , space between walls , composed of =Установить спираль с центром в WorldEdit-позиции 1 шириной , высотой и с расстоянием между витками , состоящую из блоков +Copy the current WorldEdit region along the given axis by nodes=Копировать текущий WorldEdit-регион со смещением вдоль указанной оси (x/y/z) на блоков +@1 nodes copied=скопировано @1 нод(а/ы) +Move the current WorldEdit region along the given axis by nodes=Переместить текущий WorldEdit-регион вдоль указанной оси (x/y/z) на блоков +@1 nodes moved=перемещено @1 нод(а/ы) +Stack the current WorldEdit region along the given axis times=Размножить текущий WorldEdit-регион вдоль указанной оси раз +@1 nodes stacked=размножено @1 нод(а/ы) +Stack the current WorldEdit region times by offset , , =Размножить текущий WorldEdit-регион раз с шагом , , по соответствующим осям +invalid count: @1=неверное количество: @1 +invalid increments: @1=неверные приращения(шаг) +Scale the current WorldEdit positions and region by a factor of , , along the X, Y, and Z axes, repectively, with position 1 as the origin=Масштабировать текущий WorldEdit-регион с коэффициентами , , вдоль осей X, Y и Z, используя WorldEdit-позицию 1 в качестве точки отсчёта +invalid scaling factors: @1=неверные коэффициенты масштабирования: @1 +@1 nodes stretched=масштабировано @1 нод(а/ы) +Transpose the current WorldEdit region along the given axes=Транспонировать текущий WorldEdit-регион по заданным осям. +invalid usage: axes must be different=недопустимое использование: оси должны быть разными +@1 nodes transposed=транспонировано @1 нод(а/ы) +Flip the current WorldEdit region along the given axis=Перевернуть/Отразить текущий WorldEdit-регион вдоль указанной оси +@1 nodes flipped=отражено @1 нод(а/ы) +Rotate the current WorldEdit region around the given axis by angle (90 degree increment)=Повернуть текущий WorldEdit-регион вокруг оси на угол (шаг - 90 градусов) +invalid usage: angle must be multiple of 90=недопустимое использование: угол должен быть кратен 90 +@1 nodes rotated=повёрнуто @1 нод(а/ы) +Rotate oriented nodes in the current WorldEdit region around the Y axis by angle (90 degree increment)=Повернуть блоки в текущем WorldEdit-регионе вокруг оси Y на угол (шаг - 90 градусов) +@1 nodes oriented=повёрнуто @1 нод(а/ы) +Fix the lighting in the current WorldEdit region=Исправить освещение в текущем WorldEdit-регионе +@1 nodes updated=обновлено @1 нод(а/ы) +Remove any fluid node within the current WorldEdit region=Удалить любые жидкости в текущем WorldEdit-регионе +Remove any plant, tree or foliage-like nodes in the selected region=Удалить любые растения, деревья или листье-подобные ноды в текущем WorldEdit-регионе +@1 nodes removed=удалено @1 нод(а/ы) +Hide all nodes in the current WorldEdit region non-destructively=Скрыть узлы текущего WorldEdit-региона, не удаляя их +@1 nodes hidden=скрыто @1 нод(а/ы) +Suppress all in the current WorldEdit region non-destructively=Скрыть все блоки в текущем WorldEdit-регионе, не удаляя их +@1 nodes suppressed=скрыто @1 нод(а/ы) +Highlight in the current WorldEdit region by hiding everything else non-destructively=Скрыть все блоки, кроме , в текущем WorldEdit-регионе, не удаляя их +@1 nodes highlighted="подсвечено" @1 нод(а/ы) +Restores nodes hidden with WorldEdit in the current WorldEdit region=Восстановить скрытые WorldEdit'ом узлы в текущем WorldEdit-регионе +@1 nodes restored=восстановлено @1 нод(а/ы) +Warning: The schematic contains excessive free space and WILL be misaligned when allocated or loaded. To avoid this, shrink your area to cover exactly the nodes to be saved.=Предупреждение: Схема содержит слишком много свободного места и будет смещена при размещении или загрузке. Чтобы избежать этого, уменьшите область так, чтобы она охватывала именно те узлы, которые необходимо сохранить. +Save the current WorldEdit region to "(world folder)/schems/.we"=Сохранить текущий WorldEdit-регион в файл "(world folder)/schems/.we" +Disallowed file name: @1=Недопустимое имя файла: @1 +Could not save file to "@1"=Не удалось сохранить файл в "@1" +@1 nodes saved=сохранено @1 нод(а/ы) +Set the region defined by nodes from "(world folder)/schems/.we" as the current WorldEdit region=Выделить область, определённую узлами из "(world folder)/schems/.we", как текущий WorldEdit-регион +Schematic empty, nothing allocated=Схема пуста, ничего не выделено +@1 nodes allocated=выделено @1 нод(а/ы) +Load nodes from "(world folder)/schems/[.we[m]]" with position 1 of the current WorldEdit region as the origin=Загрузить регион из "(world folder)/schems/[.we[m]]" с WorldEdit-позицией 1 в качестве точки отсчёта +Loading failed!=Не удалось загрузить! +@1 nodes loaded=загружено @1 нод(а/ы) +Executes as a Lua chunk in the global namespace=Выполнить как Lua-код в глобальном пространстве имён +Executes as a Lua chunk in the global namespace with the variable pos available, for each node in the current WorldEdit region=Выполнить как Lua-код в глобальном пространстве имён, с доступом к переменным позиций для каждого блока в текущем WordEdit-регионе +Save the current WorldEdit region using the Minetest Schematic format to "(world folder)/schems/.mts"=Сохранить текущий WorldEdit-регион с использованием сжатия в формат Minetest Schematic в файл "(world folder)/schems/.mts" +Failed to create Minetest schematic=Не удалось создать Minetest-схему +Saved Minetest schematic to @1=Minetest-схема сохранена в @1 +Load nodes from "(world folder)/schems/.mts" with position 1 of the current WorldEdit region as the origin=Загрузить блоки из "(world folder)/schems/.mts" с WorldEdit-позицией 1 в качестве точки отсчёта +failed to place Minetest schematic=не удалось загрузить Minetest-схему +placed Minetest schematic @1 at @2=Minetest-схема @1 загружена в @2 +Begins node probability entry for Minetest schematics, gets the nodes that have probabilities set, or ends node probability entry=Начать запись вероятностей для Minetest Schematic, ударяя по блокам, закончить запись вероятностей или вывести уже записанные вероятности +select Minetest schematic probability values by punching nodes=выберите значения вероятностей для Minetest-схемы, ударя по нодам +finished Minetest schematic probability selection=выбор вероятностей для Minetest-схемы завершен +currently set node probabilities:=заданные вероятности нод на данный момент: +invalid node probability given, not saved=недопустимая вероятность ноды, не сохранена +Clears all objects within the WorldEdit region=Очистить все объекты в текущем WorldEdit-регионе +@1 objects cleared=очищено @1 объектов + +### safe.lua ### +WARNING: this operation could affect up to @1 nodes; type //y to continue or //n to cancel=ПРЕДУПРЕЖДЕНИЕ: эта операция может затронуть до @1 нод; введите //y для продолжения или //n для отмены +Confirm a pending operation=Подтвердить отложенную операцию +no operation pending=нет ожидающей операции +Abort a pending operation=Отклонить отложенную операцию + +### cuboid.lua ### +Outset the selected region.=Расширить выделение региона. +Invalid direction: @1=Недопустимое направление: @1 +Invalid number of arguments=Недопустимое количество аргументов +Region outset by @1 nodes=Регион расширен на @1 нод(у/ы) +Inset the selected region.=Сузить выделение региона. +Region inset by @1 nodes=Регион сужен на @1 нод(у/ы) +Shifts the selection area without moving its contents=Сдвинуть выделение региона без перемещения его содержимого +Invalid if looking straight up or down=Недопустимо, если смотреть прямо вверх или вниз +Region shifted by @1 nodes=Регион сдвинут на @1 нод(у/ы) +Expands the selection in the selected absolute or relative axis=Увеличить выделение региона по выбранной абсолютной или относительной оси +Region expanded by @1 nodes=Регион увеличен на @1 нод(у/ы) +Contracts the selection in the selected absolute or relative axis=Уменьшить выделение региона по выбранной абсолютной или относительной оси +Region contracted by @1 nodes=Регион уменьшен на @1 нод(у/ы) +Select a cube with side length around position 1 and run on region=Выделить куб с длиной стороны вокруг позиции 1 и запустите <команду> в области +invalid usage: //@1 cannot be used with cubeapply=недопустимое использование: //@1 не может быть применено в cubeapply +Missing privileges: @1=Отсутствуют привилегии: @1 + +### wand.lua ### +WorldEdit Wand tool@nLeft-click to set 1st position, right-click to set 2nd=Инструмент WorldEdit Wand@nЛевая кнопка мыши, чтобы установить 1-ю позицию, правая кнопка мыши, чтобы установить 2-ю diff --git a/worldedit_commands/safe.lua b/worldedit_commands/safe.lua index c83cac8..1be4acc 100644 --- a/worldedit_commands/safe.lua +++ b/worldedit_commands/safe.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("worldedit_commands") + local safe_region_callback = {} --`count` is the number of nodes that would possibly be modified @@ -9,7 +11,7 @@ local function safe_region(name, count, callback) --save callback to call later safe_region_callback[name] = callback - worldedit.player_notify(name, "WARNING: this operation could affect up to " .. count .. " nodes; type //y to continue or //n to cancel") + worldedit.player_notify(name, S("WARNING: this operation could affect up to @1 nodes; type //y to continue or //n to cancel", count)) end local function reset_pending(name) @@ -18,11 +20,11 @@ end minetest.register_chatcommand("/y", { params = "", - description = "Confirm a pending operation", + description = S("Confirm a pending operation"), func = function(name) local callback = safe_region_callback[name] if not callback then - worldedit.player_notify(name, "no operation pending") + worldedit.player_notify(name, S("no operation pending")) return end @@ -33,10 +35,10 @@ minetest.register_chatcommand("/y", { minetest.register_chatcommand("/n", { params = "", - description = "Abort a pending operation", + description = S("Abort a pending operation"), func = function(name) if not safe_region_callback[name] then - worldedit.player_notify(name, "no operation pending") + worldedit.player_notify(name, S("no operation pending")) return end diff --git a/worldedit_commands/wand.lua b/worldedit_commands/wand.lua index faa77ff..b3fdcef 100644 --- a/worldedit_commands/wand.lua +++ b/worldedit_commands/wand.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("worldedit_commands") + local function above_or_under(placer, pointed_thing) if placer:get_player_control().sneak then return pointed_thing.above @@ -9,7 +11,7 @@ end local punched_air_time = {} minetest.register_tool(":worldedit:wand", { - description = "WorldEdit Wand tool\nLeft-click to set 1st position, right-click to set 2nd", + description = S("WorldEdit Wand tool\nLeft-click to set 1st position, right-click to set 2nd"), inventory_image = "worldedit_wand.png", stack_max = 1, -- there is no need to have more than one liquids_pointable = true, -- ground with only water on can be selected as well