From 2d44c915f0f55343415b2923de15ee857bdec89c Mon Sep 17 00:00:00 2001 From: Alexander Chibrikin Date: Fri, 6 Oct 2023 20:36:30 +0300 Subject: [PATCH 1/9] Translate `worldedit_commands` commands --- worldedit_commands/init.lua | 236 ++++++++++++---------- worldedit_commands/locale/worldedit.ru.tr | 91 +++++++++ worldedit_commands/safe.lua | 6 +- 3 files changed, 219 insertions(+), 114 deletions(-) create mode 100644 worldedit_commands/locale/worldedit.ru.tr diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 9bc2366..54ae6d7 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") + +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,7 +251,7 @@ 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.") @@ -263,12 +265,12 @@ 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") + "https://github.com/Uberi/Minetest-WorldEdit", worldedit.version_string)) end, }) @@ -276,7 +278,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 +295,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 +305,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 +316,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 +330,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 +344,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 +376,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 @@ -394,7 +406,7 @@ worldedit.register_command("reset", { 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) @@ -404,7 +416,7 @@ worldedit.register_command("mark", { 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] @@ -419,60 +431,60 @@ worldedit.register_command("unmark", { 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"), 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 2 to the player's location"), 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: ") .. 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])) 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])) else - worldedit.player_notify(name, "position 2 not set") + worldedit.player_notify(name, S("position @1 not set", 2)) end end end, @@ -480,7 +492,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 +505,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 +521,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 +541,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) @@ -546,7 +558,7 @@ worldedit.register_command("volume", { 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 +566,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 +602,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 +629,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 +643,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 +654,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, @@ -686,14 +698,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 +714,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 +729,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 +740,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 +756,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 +771,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 +782,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 +798,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 +813,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,7 +830,7 @@ 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 @@ -840,13 +852,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 +873,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 +884,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 +905,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 +925,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 +941,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 +950,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) @@ -971,7 +983,7 @@ worldedit.register_command("copy", { 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) @@ -1003,7 +1015,7 @@ worldedit.register_command("move", { 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) @@ -1033,7 +1045,7 @@ worldedit.register_command("stack", { 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) @@ -1063,7 +1075,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) @@ -1095,7 +1107,7 @@ worldedit.register_command("stretch", { 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) @@ -1125,7 +1137,7 @@ worldedit.register_command("transpose", { 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) @@ -1144,7 +1156,7 @@ worldedit.register_command("flip", { 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) @@ -1175,7 +1187,7 @@ worldedit.register_command("rotate", { 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) @@ -1198,7 +1210,7 @@ worldedit.register_command("orient", { 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, @@ -1210,7 +1222,7 @@ worldedit.register_command("fixlight", { 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, @@ -1308,7 +1320,7 @@ 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, @@ -1321,7 +1333,7 @@ worldedit.register_command("clearcut", { 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, @@ -1333,13 +1345,13 @@ worldedit.register_command("hide", { 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, @@ -1352,13 +1364,13 @@ worldedit.register_command("suppress", { 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, @@ -1371,7 +1383,7 @@ worldedit.register_command("highlight", { 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, @@ -1400,7 +1412,7 @@ 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) @@ -1438,7 +1450,7 @@ worldedit.register_command("save", { 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) @@ -1474,7 +1486,7 @@ worldedit.register_command("allocate", { 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) @@ -1505,7 +1517,7 @@ worldedit.register_command("load", { 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 +1536,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 +1557,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) @@ -1579,7 +1591,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) @@ -1606,7 +1618,7 @@ worldedit.register_command("mtschemplace", { 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 @@ -1656,7 +1668,7 @@ 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, diff --git a/worldedit_commands/locale/worldedit.ru.tr b/worldedit_commands/locale/worldedit.ru.tr new file mode 100644 index 0000000..1acc890 --- /dev/null +++ b/worldedit_commands/locale/worldedit.ru.tr @@ -0,0 +1,91 @@ +# textdomain: worldedit + +### 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!=Не верный формат файла! + +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 https://github.com/Uberi/Minetest-WorldEdit=WorldEdit @1 доступен на этом сервере. Наберите команду //help чтобы увидеть список команд, больше информации по ссылке https://github.com/Uberi/Minetest-WorldEdit +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=Сбросить выделение области +Show markers at the region positions=Отобразить маркеры выделенной области +Hide markers if currently shown=Скрыть маркеры выделенной области +Set WorldEdit region position 1 to the player's location=Установить маркер 1 для WorldEdit-региона в месте нахождения игрока +Set WorldEdit region position 2 to the player's location=Установить маркер 2 для WorldEdit-региона в месте нахождения игрока +Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching nodes, or display the current WorldEdit region=Выделить WorldEdit-регион или установить маркеры для WorldEdit-региона, либо отобразить уже выбранную область +unknown subcommand: =неизвестная подкоманда: +select positions by punching two nodes=выберите позиции, ударив по блокам +select position @1 by punching a node=выберите позицию @1, ударив по блоку +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 (кол-во нод, размеры) +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-области +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) на блоков +Move the current WorldEdit region along the given axis by nodes=Переместить текущий WorldEdit-регион вдоль указанной оси (x/y/z) на блоков +Stack the current WorldEdit region along the given axis times=Размножить текущий WorldEdit-регион вдоль указанной оси раз +Stack the current WorldEdit region times by offset , , =Размножить текущий WorldEdit-регион раз с шагом , , по соответствующим осям +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 в качестве точки отсчёта +Transpose the current WorldEdit region along the given axes=Транспонировать текущий WorldEdit-регион по заданным осям. +Flip the current WorldEdit region along the given axis=Перевернуть/Отразить текущий WorldEdit-регион вдоль указанной оси +Rotate the current WorldEdit region around the given axis by angle (90 degree increment)=Повернуть текущий WorldEdit-регион вокруг оси на угол (шаг - 90 градусов) +Rotate oriented nodes in the current WorldEdit region around the Y axis by angle (90 degree increment)=Повернуть блоки в текущем WorldEdit-регионе вокруг оси Y на угол (шаг - 90 градусов) +Fix the lighting in the current WorldEdit region=Исправить освещение в текущем WorldEdit-регионе +Remove any fluid node within the current WorldEdit region=Удалить любые жидкости в текущем WorldEdit-регионе +Remove any plant, tree or foliage-like nodes in the selected region=Удалить любые растения, деревья или листье-подобные ноды в текущем WorldEdit-регионе +Hide all nodes in the current WorldEdit region non-destructively=Скрыть узлы текущего WorldEdit-региона, не удаляя их +Suppress all in the current WorldEdit region non-destructively=Скрыть все блоки в текущем WorldEdit-регионе, не удаляя их +Highlight in the current WorldEdit region by hiding everything else non-destructively=Скрыть все блоки, кроме , в текущем WorldEdit-регионе, не удаляя их +Restores nodes hidden with WorldEdit in the current WorldEdit region=Восстановить скрытые WorldEdit'ом узлы в текущем WorldEdit-регионе +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" +Set the region defined by nodes from "(world folder)/schems/.we" as the current WorldEdit region=Установить область, определённую узлами из "(world folder)/schems/.we", как текущий WorldEdit-регион +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 в качестве точки отсчёта +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" +Load nodes from "(world folder)/schems/.mts" with position 1 of the current WorldEdit region as the origin=Загрузить блоки из "(world folder)/schems/.mts" с WorldEdit-позицией 1 в качестве точки отсчёта +Begins node probability entry for Minetest schematics, gets the nodes that have probabilities set, or ends node probability entry=Начать запись вероятностей для Minetest Schematic, ударяя по блокам, закончить запись вероятностей или вывести уже записанные вероятности +Clears all objects within the WorldEdit region=Очистить все объекты в текущем WorldEdit-регионе + +### safe.lua ### +Confirm a pending operation=Подтвердить отложенную операцию +Abort a pending operation=Отклонить отложенную операцию diff --git a/worldedit_commands/safe.lua b/worldedit_commands/safe.lua index c83cac8..baa28a4 100644 --- a/worldedit_commands/safe.lua +++ b/worldedit_commands/safe.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("worldedit") + local safe_region_callback = {} --`count` is the number of nodes that would possibly be modified @@ -18,7 +20,7 @@ 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 @@ -33,7 +35,7 @@ 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") From a3a8e742742297620ac6ecbdb578cafda09dada3 Mon Sep 17 00:00:00 2001 From: Alexander Chibrikin Date: Wed, 11 Oct 2023 23:29:07 +0300 Subject: [PATCH 2/9] fix inspect command translation --- worldedit_commands/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 54ae6d7..80165cd 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -377,7 +377,7 @@ minetest.register_on_punchnode(function(pos, node, puncher) if worldedit.inspect[name] then local axis, sign = worldedit.player_axis(name) local message = S( - S("inspector: @1 at @2 (param1=@3, param2=@4, received light=@5) punched facing the @6 axis"), + "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, From 7f9579ae4f74a3e7ebb1cd7cba785ce2eb7631a1 Mon Sep 17 00:00:00 2001 From: Alexander Chibrikin Date: Mon, 16 Oct 2023 23:42:05 +0300 Subject: [PATCH 3/9] make documentation url (`/about` cmd) a param, not a part of translation string --- worldedit_commands/init.lua | 8 +++++--- worldedit_commands/locale/worldedit.ru.tr | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 80165cd..9409cea 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -269,8 +269,10 @@ worldedit.register_command("about", { func = function(name) 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", worldedit.version_string)) + "commands, or get more information at @2", + worldedit.version_string, + "https://github.com/Uberi/Minetest-WorldEdit" + )) end, }) @@ -377,7 +379,7 @@ minetest.register_on_punchnode(function(pos, node, puncher) if worldedit.inspect[name] then local axis, sign = worldedit.player_axis(name) local message = S( - "inspector: @1 at @2 (param1=@3, param2=@4, received light=@5) punched facing the @6 axis", + 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, diff --git a/worldedit_commands/locale/worldedit.ru.tr b/worldedit_commands/locale/worldedit.ru.tr index 1acc890..5c8d3bd 100644 --- a/worldedit_commands/locale/worldedit.ru.tr +++ b/worldedit_commands/locale/worldedit.ru.tr @@ -10,7 +10,7 @@ Could not open file "@1"=Не удаётся открыть файл "@1" Invalid file format!=Не верный формат файла! 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 https://github.com/Uberi/Minetest-WorldEdit=WorldEdit @1 доступен на этом сервере. Наберите команду //help чтобы увидеть список команд, больше информации по ссылке https://github.com/Uberi/Minetest-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' для вывода подсказок по всем командам. From 58e1ead56386e583732f9458a87bc40fc0f76415 Mon Sep 17 00:00:00 2001 From: Alexander Chibrikin Date: Tue, 17 Oct 2023 00:12:25 +0300 Subject: [PATCH 4/9] add missed translation (`/p` cmd) --- worldedit_commands/init.lua | 4 ++-- worldedit_commands/locale/worldedit.ru.tr | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 9409cea..d2c7070 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -479,12 +479,12 @@ worldedit.register_command("p", { 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, 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, S("position @1 not set", 2)) end diff --git a/worldedit_commands/locale/worldedit.ru.tr b/worldedit_commands/locale/worldedit.ru.tr index 5c8d3bd..bdb521d 100644 --- a/worldedit_commands/locale/worldedit.ru.tr +++ b/worldedit_commands/locale/worldedit.ru.tr @@ -29,6 +29,7 @@ Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching unknown subcommand: =неизвестная подкоманда: 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 From e2eb2d3018c8286d3586d73ec5a27d08cd81d474 Mon Sep 17 00:00:00 2001 From: Alexander Chibrikin Date: Tue, 17 Oct 2023 00:15:28 +0300 Subject: [PATCH 5/9] Deduplicate translation strings for `/pos1` & `/pos2` commands --- worldedit_commands/init.lua | 4 ++-- worldedit_commands/locale/worldedit.ru.tr | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index d2c7070..0badf7a 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -433,7 +433,7 @@ worldedit.register_command("unmark", { worldedit.register_command("pos1", { params = "", - description = S("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() @@ -446,7 +446,7 @@ worldedit.register_command("pos1", { worldedit.register_command("pos2", { params = "", - description = S("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() diff --git a/worldedit_commands/locale/worldedit.ru.tr b/worldedit_commands/locale/worldedit.ru.tr index bdb521d..c943ec7 100644 --- a/worldedit_commands/locale/worldedit.ru.tr +++ b/worldedit_commands/locale/worldedit.ru.tr @@ -23,8 +23,7 @@ inspector: @1 at @2 (param1=@3, param2=@4, received light=@5) punched facing the Reset the region so that it is empty=Сбросить выделение области Show markers at the region positions=Отобразить маркеры выделенной области Hide markers if currently shown=Скрыть маркеры выделенной области -Set WorldEdit region position 1 to the player's location=Установить маркер 1 для WorldEdit-региона в месте нахождения игрока -Set WorldEdit region position 2 to the player's location=Установить маркер 2 для WorldEdit-региона в месте нахождения игрока +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: =неизвестная подкоманда: select positions by punching two nodes=выберите позиции, ударив по блокам From 6cb72a8389d8e1793629d836e059f4305dae1133 Mon Sep 17 00:00:00 2001 From: Alexander Chibrikin Date: Tue, 17 Oct 2023 00:20:03 +0300 Subject: [PATCH 6/9] add `template.txt` for locale translations --- worldedit_commands/locale/template.txt | 91 ++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 worldedit_commands/locale/template.txt diff --git a/worldedit_commands/locale/template.txt b/worldedit_commands/locale/template.txt new file mode 100644 index 0000000..7d9f877 --- /dev/null +++ b/worldedit_commands/locale/template.txt @@ -0,0 +1,91 @@ +# textdomain: worldedit + +### init.lua ### +Can use WorldEdit commands= + +no region selected= +no position 1 selected= +invalid usage= +Could not open file "@1"= +Invalid file format!= + +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= +Show markers at the region positions= +Hide markers if currently shown= +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: = +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= +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= +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= +Move the current WorldEdit region along the given axis by nodes= +Stack the current WorldEdit region along the given axis times= +Stack the current WorldEdit region times by offset , , = +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= +Transpose the current WorldEdit region along the given axes= +Flip the current WorldEdit region along the given axis= +Rotate the current WorldEdit region around the given axis by angle (90 degree increment)= +Rotate oriented nodes in the current WorldEdit region around the Y axis by angle (90 degree increment)= +Fix the lighting in the current WorldEdit region= +Remove any fluid node within the current WorldEdit region= +Remove any plant, tree or foliage-like nodes in the selected region= +Hide all nodes in the current WorldEdit region non-destructively= +Suppress all in the current WorldEdit region non-destructively= +Highlight in the current WorldEdit region by hiding everything else non-destructively= +Restores nodes hidden with WorldEdit in the current WorldEdit region= +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"= +Set the region defined by nodes from "(world folder)/schems/.we" as the current WorldEdit region= +Load nodes from "(world folder)/schems/[.we[m]]" with position 1 of the current WorldEdit region as the origin= +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"= +Load nodes from "(world folder)/schems/.mts" with position 1 of the current WorldEdit region as the origin= +Begins node probability entry for Minetest schematics, gets the nodes that have probabilities set, or ends node probability entry= +Clears all objects within the WorldEdit region= + +### safe.lua ### +Confirm a pending operation= +Abort a pending operation= From c6ae70a96bbc38cfd8da4570c681a69e9b676326 Mon Sep 17 00:00:00 2001 From: Alexander Chibrikin Date: Wed, 18 Oct 2023 05:45:43 +0300 Subject: [PATCH 7/9] Add missing translations in `init.lua`, translate `safe.lua` & `cuboid.lua`. --- worldedit_commands/cuboid.lua | 41 ++++---- worldedit_commands/init.lua | 118 +++++++++++----------- worldedit_commands/locale/template.txt | 62 +++++++++++- worldedit_commands/locale/worldedit.ru.tr | 64 +++++++++++- worldedit_commands/safe.lua | 6 +- 5 files changed, 207 insertions(+), 84 deletions(-) diff --git a/worldedit_commands/cuboid.lua b/worldedit_commands/cuboid.lua index 93e45fa..050cf94 100644 --- a/worldedit_commands/cuboid.lua +++ b/worldedit_commands/cuboid.lua @@ -1,6 +1,8 @@ +local S = minetest.get_translator("worldedit") + 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 blocks", 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 blocks", 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) @@ -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 0badf7a..c1d81ea 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -254,7 +254,7 @@ local function open_schematic(name, param) 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 @@ -402,7 +402,7 @@ 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, }) @@ -412,7 +412,7 @@ worldedit.register_command("mark", { privs = {worldedit=true}, func = function(name) worldedit.marker_update(name) - worldedit.player_notify(name, "region marked") + worldedit.player_notify(name, S("region marked")) end, }) @@ -427,7 +427,7 @@ 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, }) @@ -465,7 +465,7 @@ worldedit.register_command("p", { if param == "set" or param == "set1" or param == "set2" or param == "get" then return true, param end - return false, S("unknown subcommand: ") .. param + return false, S("unknown subcommand: @1", param) end, func = function(name, param) if param == "set" then --set both WorldEdit positions @@ -551,10 +551,13 @@ 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, }) @@ -675,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, }) @@ -689,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, }) @@ -839,7 +842,7 @@ 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, @@ -979,7 +982,7 @@ 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, }) @@ -1011,7 +1014,7 @@ 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, }) @@ -1040,7 +1043,7 @@ 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, }) @@ -1053,11 +1056,11 @@ worldedit.register_command("stack2", { 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)) @@ -1069,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, }) @@ -1087,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, @@ -1103,7 +1106,7 @@ 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, }) @@ -1117,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, @@ -1133,7 +1136,7 @@ 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, }) @@ -1152,7 +1155,7 @@ 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, }) @@ -1168,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, @@ -1183,7 +1186,7 @@ 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, }) @@ -1199,14 +1202,14 @@ 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, }) @@ -1218,7 +1221,7 @@ worldedit.register_command("fixlight", { 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, }) @@ -1247,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, }) @@ -1329,7 +1332,7 @@ worldedit.register_command("clearcut", { 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, }) @@ -1341,7 +1344,7 @@ worldedit.register_command("hide", { 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, }) @@ -1360,7 +1363,7 @@ worldedit.register_command("suppress", { 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, }) @@ -1379,7 +1382,7 @@ worldedit.register_command("highlight", { 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, }) @@ -1391,7 +1394,7 @@ worldedit.register_command("restore", { 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, }) @@ -1405,9 +1408,9 @@ 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 @@ -1422,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, @@ -1439,14 +1442,14 @@ 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")) end, }) @@ -1460,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, @@ -1474,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 @@ -1482,7 +1485,7 @@ 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, }) @@ -1496,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, @@ -1510,10 +1513,10 @@ 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, }) @@ -1568,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, @@ -1583,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, @@ -1601,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, @@ -1610,10 +1613,9 @@ 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, }) @@ -1624,7 +1626,7 @@ worldedit.register_command("mtschemprob", { 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, @@ -1632,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] @@ -1646,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, @@ -1661,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 @@ -1676,6 +1678,6 @@ worldedit.register_command("clearobjects", { 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 index 7d9f877..b11a353 100644 --- a/worldedit_commands/locale/template.txt +++ b/worldedit_commands/locale/template.txt @@ -8,6 +8,7 @@ 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= @@ -21,11 +22,14 @@ 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: = +unknown subcommand: @1= select positions by punching two nodes= select position @1 by punching a node= position @1: @2= @@ -33,6 +37,7 @@ 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.= @@ -46,6 +51,7 @@ 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= @@ -60,32 +66,86 @@ Add hollow pyramid centered at WorldEdit position 1 along the given axis with he 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 blocks= +Inset the selected region.= +Region inset by @1 blocks= +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= +Missing privileges: @1= diff --git a/worldedit_commands/locale/worldedit.ru.tr b/worldedit_commands/locale/worldedit.ru.tr index c943ec7..0f19659 100644 --- a/worldedit_commands/locale/worldedit.ru.tr +++ b/worldedit_commands/locale/worldedit.ru.tr @@ -8,6 +8,7 @@ no position 1 selected=не установлена позиция региона 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 @@ -21,11 +22,14 @@ inspector: inspection enabled for @1, currently facing the @2 axis=inspector: и 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: =неизвестная подкоманда: +unknown subcommand: @1=неизвестная подкоманда: @1 select positions by punching two nodes=выберите позиции, ударив по блокам select position @1 by punching a node=выберите позицию @1, ударив по блоку position @1: @2=позиция @1: @2 @@ -33,6 +37,7 @@ 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.=Что-то пошло не так при удалении области. @@ -46,6 +51,7 @@ Fill the current WorldEdit region with a random mix of , ...=Заполн 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 блок(а/ов) @@ -60,32 +66,86 @@ Add hollow pyramid centered at WorldEdit position 1 along the given axis with he 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" -Set the region defined by nodes from "(world folder)/schems/.we" as the current WorldEdit region=Установить область, определённую узлами из "(world folder)/schems/.we", как текущий WorldEdit-регион +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 blocks=Регион расширен на @1 блок(а/ов) +Inset the selected region.=Сузить выделение региона. +Region inset by @1 blocks=Регион сужен на @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 и запустите <команду> в области +Missing privileges: @1=Отсутствуют привилегии: @1 diff --git a/worldedit_commands/safe.lua b/worldedit_commands/safe.lua index baa28a4..79b8445 100644 --- a/worldedit_commands/safe.lua +++ b/worldedit_commands/safe.lua @@ -11,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) @@ -24,7 +24,7 @@ minetest.register_chatcommand("/y", { 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 @@ -38,7 +38,7 @@ minetest.register_chatcommand("/n", { 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 From 62bb1cc5efd0df3582c14ed9cd66ceaeba3b78cd Mon Sep 17 00:00:00 2001 From: Alexander Chibrikin Date: Thu, 19 Oct 2023 17:21:00 +0300 Subject: [PATCH 8/9] Add `wand.lua` translarion. Some fixes for translations: - add missed `count` var - fix terminology "blocks" -> "nodes" for `//outset` `//inset` - change textdomain `worldedit` -> `worldedit_commands` - add missed translation ("invalid usage") in `//cubeapply` --- worldedit_commands/cuboid.lua | 8 ++++---- worldedit_commands/init.lua | 4 ++-- worldedit_commands/locale/template.txt | 10 +++++++--- worldedit_commands/locale/worldedit.ru.tr | 10 +++++++--- worldedit_commands/safe.lua | 2 +- worldedit_commands/wand.lua | 4 +++- 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/worldedit_commands/cuboid.lua b/worldedit_commands/cuboid.lua index 050cf94..1da5d98 100644 --- a/worldedit_commands/cuboid.lua +++ b/worldedit_commands/cuboid.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("worldedit") +local S = minetest.get_translator("worldedit_commands") worldedit.register_command("outset", { params = "[h/v] ", @@ -34,7 +34,7 @@ worldedit.register_command("outset", { end worldedit.marker_update(name) - return true, S("Region outset by @1 blocks", amount) + return true, S("Region outset by @1 nodes", amount) end, }) @@ -71,7 +71,7 @@ worldedit.register_command("inset", { end worldedit.marker_update(name) - return true, S("Region inset by @1 blocks", amount) + return true, S("Region inset by @1 nodes", amount) end, }) @@ -232,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)} diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index c1d81ea..2dda953 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("worldedit") +local S = minetest.get_translator("worldedit_commands") minetest.register_privilege("worldedit", S("Can use WorldEdit commands")) @@ -1449,7 +1449,7 @@ worldedit.register_command("save", { file:flush() file:close() - worldedit.player_notify(name, S("@1 nodes saved")) + worldedit.player_notify(name, S("@1 nodes saved", count)) end, }) diff --git a/worldedit_commands/locale/template.txt b/worldedit_commands/locale/template.txt index b11a353..d9a40a8 100644 --- a/worldedit_commands/locale/template.txt +++ b/worldedit_commands/locale/template.txt @@ -1,4 +1,4 @@ -# textdomain: worldedit +# textdomain: worldedit_commands ### init.lua ### Can use WorldEdit commands= @@ -137,9 +137,9 @@ Abort a pending operation= Outset the selected region.= Invalid direction: @1= Invalid number of arguments= -Region outset by @1 blocks= +Region outset by @1 nodes= Inset the selected region.= -Region inset by @1 blocks= +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= @@ -148,4 +148,8 @@ 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.ru.tr b/worldedit_commands/locale/worldedit.ru.tr index 0f19659..9c86b08 100644 --- a/worldedit_commands/locale/worldedit.ru.tr +++ b/worldedit_commands/locale/worldedit.ru.tr @@ -1,4 +1,4 @@ -# textdomain: worldedit +# textdomain: worldedit_commands ### init.lua ### Can use WorldEdit commands=Возможность редактировать мир с помощью команд WorldEdit @@ -137,9 +137,9 @@ Abort a pending operation=Отклонить отложенную операци Outset the selected region.=Расширить выделение региона. Invalid direction: @1=Недопустимое направление: @1 Invalid number of arguments=Недопустимое количество аргументов -Region outset by @1 blocks=Регион расширен на @1 блок(а/ов) +Region outset by @1 nodes=Регион расширен на @1 нод(у/ы) Inset the selected region.=Сузить выделение региона. -Region inset by @1 blocks=Регион сужен на @1 блок(а/ов) +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 нод(у/ы) @@ -148,4 +148,8 @@ 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 79b8445..1be4acc 100644 --- a/worldedit_commands/safe.lua +++ b/worldedit_commands/safe.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("worldedit") +local S = minetest.get_translator("worldedit_commands") local safe_region_callback = {} 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 From 51f37998bcdb241f42e17e06dd10c6131925ef5c Mon Sep 17 00:00:00 2001 From: Alexander Chibrikin Date: Mon, 23 Oct 2023 19:03:34 +0300 Subject: [PATCH 9/9] Rename translation file `worldedit.ru.tr` -> `worldedit_command.ru.tr` --- .../locale/{worldedit.ru.tr => worldedit_command.ru.tr} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename worldedit_commands/locale/{worldedit.ru.tr => worldedit_command.ru.tr} (100%) diff --git a/worldedit_commands/locale/worldedit.ru.tr b/worldedit_commands/locale/worldedit_command.ru.tr similarity index 100% rename from worldedit_commands/locale/worldedit.ru.tr rename to worldedit_commands/locale/worldedit_command.ru.tr