From 45afbfe8a668106f3b9ebe7b73638e19bbed1bfa Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Sat, 26 Nov 2016 07:20:23 +0000 Subject: [PATCH 01/30] add protector blocks to hud --- api.lua | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/api.lua b/api.lua index e8b9c7a..bce3713 100644 --- a/api.lua +++ b/api.lua @@ -1,7 +1,31 @@ +local get_protector_area = function(pos) + -- Add protector to the hud + local res = {} + local radius = (tonumber(minetest.setting_get("protector_radius")) or 5) + local protectors = minetest.find_nodes_in_area( + {x=pos.x -radius , y=pos.y -radius , z=pos.z -radius}, + {x=pos.x +radius , y=pos.y +radius , z=pos.z +radius}, + {"protector:protect","protector:protect2"} + ) + for _,npos in pairs(protectors) do + local node = minetest.get_node(npos) + local meta = minetest.get_meta(npos) + local nodeowner = meta:get_string("owner") + if minetest.is_protected(pos,nodeowner) then + res["protector"] = {name="("..node.name..")",owner=nodeowner} + break + end + end + return res +end +-- // + --- Returns a list of areas that include the provided position. function areas:getAreasAtPos(pos) local res = {} + --res = get_protector_area(pos) + if self.store then local a = self.store:get_areas_for_pos(pos, false, true) for store_id, store_area in pairs(a) do @@ -13,9 +37,10 @@ function areas:getAreasAtPos(pos) for id, area in pairs(self.areas) do local ap1, ap2 = area.pos1, area.pos2 if - (px >= ap1.x and px <= ap2.x) and - (py >= ap1.y and py <= ap2.y) and - (pz >= ap1.z and pz <= ap2.z) then + (px >= ap1.x and px <= ap2.x) and + (py >= ap1.y and py <= ap2.y) and + (pz >= ap1.z and pz <= ap2.z) + then res[id] = area end end From 2f802bf7809ec398f34ee984a77ab6494c55ba6f Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Sat, 26 Nov 2016 07:20:26 +0000 Subject: [PATCH 02/30] change from unknown source --- internal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal.lua b/internal.lua index bf7e92c..05a31cd 100644 --- a/internal.lua +++ b/internal.lua @@ -1,6 +1,6 @@ function areas:player_exists(name) - return minetest.get_auth_handler().get_auth(name) ~= nil + return minetest.auth_table[name] ~= nil end -- Save the areas table to a file From e1e719b1d66bbc09ec625d038c4dec5000c3bbda Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Sat, 26 Nov 2016 12:13:33 +0000 Subject: [PATCH 03/30] add mod explicit name --- mod.conf | 1 + 1 file changed, 1 insertion(+) create mode 100644 mod.conf diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..0ca8ec1 --- /dev/null +++ b/mod.conf @@ -0,0 +1 @@ +name = areas From dedd0ebf6ec847b44787cada51a173f1af29e2ef Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Sat, 26 Nov 2016 12:14:30 +0000 Subject: [PATCH 04/30] Add handler for other mods to advise protection * Allow other mods to register a handler to display protected areas in the hud * remove the protector mod specific code from this areas code --- api.lua | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/api.lua b/api.lua index bce3713..6442138 100644 --- a/api.lua +++ b/api.lua @@ -1,30 +1,25 @@ +local protection_detectors = {} -local get_protector_area = function(pos) - -- Add protector to the hud - local res = {} - local radius = (tonumber(minetest.setting_get("protector_radius")) or 5) - local protectors = minetest.find_nodes_in_area( - {x=pos.x -radius , y=pos.y -radius , z=pos.z -radius}, - {x=pos.x +radius , y=pos.y +radius , z=pos.z +radius}, - {"protector:protect","protector:protect2"} - ) - for _,npos in pairs(protectors) do - local node = minetest.get_node(npos) - local meta = minetest.get_meta(npos) - local nodeowner = meta:get_string("owner") - if minetest.is_protected(pos,nodeowner) then - res["protector"] = {name="("..node.name..")",owner=nodeowner} - break - end +areas.register_protector_detector = function(handler) + protection_detectors[#protection_detectors+1] = handler +end + +local detect_extra_protection = function(pos,res) + if #protection_detectors <= 0 then + return res + end + + for idx=1,#protection_detectors do + local func = protection_detectors[idx] + res = func(pos,res) end return res end --- // --- Returns a list of areas that include the provided position. function areas:getAreasAtPos(pos) local res = {} - --res = get_protector_area(pos) + res = detect_extra_protection(pos,res) if self.store then local a = self.store:get_areas_for_pos(pos, false, true) From e4ac30b7ff74432aada42bad48f82e75d8c906a4 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Sat, 26 Nov 2016 12:15:59 +0000 Subject: [PATCH 05/30] support non-numeric IDs --- hud.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hud.lua b/hud.lua index 4908b92..764c2e3 100644 --- a/hud.lua +++ b/hud.lua @@ -8,7 +8,7 @@ minetest.register_globalstep(function(dtime) local pos = vector.round(player:getpos()) local areaStrings = {} for id, area in pairs(areas:getAreasAtPos(pos)) do - table.insert(areaStrings, ("%s [%u] (%s%s)") + table.insert(areaStrings, ("%s [%s] (%s%s)") :format(area.name, id, area.owner, area.open and ":open" or "")) end From 6708c966ca710f53dc2c9f071da4892745b50a97 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Sat, 26 Nov 2016 12:23:46 +0000 Subject: [PATCH 06/30] adjusted handler registration name --- api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 6442138..87073a5 100644 --- a/api.lua +++ b/api.lua @@ -1,6 +1,6 @@ local protection_detectors = {} -areas.register_protector_detector = function(handler) +areas.register_hud_handler = function(handler) protection_detectors[#protection_detectors+1] = handler end From 77a30f9e05332a022fdd90dd00b4dc8cb6d3cea7 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Sat, 26 Nov 2016 12:32:11 +0000 Subject: [PATCH 07/30] commentary --- api.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api.lua b/api.lua index 87073a5..40ecdea 100644 --- a/api.lua +++ b/api.lua @@ -1,9 +1,11 @@ local protection_detectors = {} +-- Other protection mods should be able to display their protection in the hud areas.register_hud_handler = function(handler) protection_detectors[#protection_detectors+1] = handler end +-- Generalized call to registered handlers to add their proeciton labels to the areas list local detect_extra_protection = function(pos,res) if #protection_detectors <= 0 then return res From 70ed7e34a06d0c32fd24b245cca4795ec21349cd Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Sat, 26 Nov 2016 12:33:27 +0000 Subject: [PATCH 08/30] add API documentation for modding extension --- api.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 api.md diff --git a/api.md b/api.md new file mode 100644 index 0000000..a0fcae7 --- /dev/null +++ b/api.md @@ -0,0 +1,21 @@ +# API Extension + +Adding your protections to the HUD +---------------------------------- + +If you are providing an extra protection mod to work in cunjunction with the +HUD feature of `areas`, you can register a callback to add your mod's code to +display your protection's existence. For example + + local myhandler = function(pos,arealist) + local areaowner = find_my_protections(pos) + + if areaowner then + arealist["mymodname"] = { + name = "Protection name", + owner = areaowner, + } + end + end + + areas.register_hud_handler(myhandler) From 4eda120fc1dac45e5867ccf26319d617f636cfc1 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Sat, 26 Nov 2016 13:27:15 +0000 Subject: [PATCH 09/30] rename to explicit variables --- api.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api.lua b/api.lua index 40ecdea..e07785e 100644 --- a/api.lua +++ b/api.lua @@ -2,20 +2,20 @@ local protection_detectors = {} -- Other protection mods should be able to display their protection in the hud areas.register_hud_handler = function(handler) - protection_detectors[#protection_detectors+1] = handler + protection_detectors[#protection_detectors + 1] = handler end -- Generalized call to registered handlers to add their proeciton labels to the areas list -local detect_extra_protection = function(pos,res) +local detect_extra_protection = function(pos,area_list) if #protection_detectors <= 0 then - return res + return area_list end for idx=1,#protection_detectors do local func = protection_detectors[idx] - res = func(pos,res) + area_list = func(pos,area_list) end - return res + return area_list end --- Returns a list of areas that include the provided position. From 60d7a41c8cad27f052e179f5bfa7846a4b5e9f47 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Sat, 26 Nov 2016 13:48:48 +0000 Subject: [PATCH 10/30] De-couple from original code * `api.lua` create separate handler for listing registered nodes, leave the areas list clean * `hud.lua` call second handler separately * `api.md` extended and clarified documentaion --- api.lua | 7 ++++++- api.md | 31 ++++++++++++++++++++++++++++--- hud.lua | 15 ++++++++++++++- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/api.lua b/api.lua index e07785e..fc9d41c 100644 --- a/api.lua +++ b/api.lua @@ -18,10 +18,15 @@ local detect_extra_protection = function(pos,area_list) return area_list end +function areas:getRegisteredProtections(pos) + local res = {} + res = detect_extra_protection(pos,res) + return res +end + --- Returns a list of areas that include the provided position. function areas:getAreasAtPos(pos) local res = {} - res = detect_extra_protection(pos,res) if self.store then local a = self.store:get_areas_for_pos(pos, false, true) diff --git a/api.md b/api.md index a0fcae7..dac876b 100644 --- a/api.md +++ b/api.md @@ -5,13 +5,38 @@ Adding your protections to the HUD If you are providing an extra protection mod to work in cunjunction with the HUD feature of `areas`, you can register a callback to add your mod's code to -display your protection's existence. For example +display your protection's existence. - local myhandler = function(pos,arealist) +Registering a handler: + +* `areas.register_hud_handler(handler_name) --> nil` + +Handler specification: + +* `handler_name(pos,area_list) --> new_area_list` + * `pos` - the position at which to check for protection coverage by your mod + * `area_list` - the current list of protected areas + * `new_area_list` - the list of protected areas, updated with your entries + +Area list items: + +The area list item is a map table identified with an ID, and properties + +The ID should be in the format `modname:` and appended with an identifier for the protection. + +Each area list item should be a table with the following properties + +* `owner` - (required) the name of the protection owner +* `name` - (optional) the name of the area + +Example +------- + + local myhandler = function(pos,area_list) local areaowner = find_my_protections(pos) if areaowner then - arealist["mymodname"] = { + arealist["mymodname:first"] = { name = "Protection name", owner = areaowner, } diff --git a/hud.lua b/hud.lua index 764c2e3..4ef96f4 100644 --- a/hud.lua +++ b/hud.lua @@ -7,11 +7,24 @@ minetest.register_globalstep(function(dtime) local name = player:get_player_name() local pos = vector.round(player:getpos()) local areaStrings = {} + for id, area in pairs(areas:getAreasAtPos(pos)) do - table.insert(areaStrings, ("%s [%s] (%s%s)") + table.insert(areaStrings, ("%s [%i] (%s%s)") :format(area.name, id, area.owner, area.open and ":open" or "")) end + + for id, area in pairs(areas:getRegisteredProtections(pos)) do + table.insert( + areaStrings, ("%s [%s] (%s)") + :format( + area.name or "", + id , + area.owner + ) + ) + end + local areaString = "Areas:" if #areaStrings > 0 then areaString = areaString.."\n".. From 73cb4c422dea9d1bee4040f84c5dc6690e383e48 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Mon, 28 Nov 2016 18:57:49 +0800 Subject: [PATCH 11/30] fixed typo in documentation --- api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.md b/api.md index dac876b..a5a932c 100644 --- a/api.md +++ b/api.md @@ -3,7 +3,7 @@ Adding your protections to the HUD ---------------------------------- -If you are providing an extra protection mod to work in cunjunction with the +If you are providing an extra protection mod to work in conjunction with the HUD feature of `areas`, you can register a callback to add your mod's code to display your protection's existence. From 83dcc447944973925d5c6684e0d96fcc34386724 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Mon, 28 Nov 2016 18:59:16 +0800 Subject: [PATCH 12/30] ignore vim cache files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5236e1e..70bb2a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *~ +*.swp From 812917fca28bf1d49420439ee3cd82989d5017af Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Mon, 28 Nov 2016 19:00:01 +0800 Subject: [PATCH 13/30] adjust handler registration function name --- api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.md b/api.md index a5a932c..459e3bc 100644 --- a/api.md +++ b/api.md @@ -9,11 +9,11 @@ display your protection's existence. Registering a handler: -* `areas.register_hud_handler(handler_name) --> nil` +* `areas.registerHudHandler(handler) --> nil` Handler specification: -* `handler_name(pos,area_list) --> new_area_list` +* `handler(pos,area_list) --> new_area_list` * `pos` - the position at which to check for protection coverage by your mod * `area_list` - the current list of protected areas * `new_area_list` - the list of protected areas, updated with your entries From 64ec6ff68f38b32a3bf8f071febdb77bd7355d1b Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Mon, 28 Nov 2016 22:37:01 +0800 Subject: [PATCH 14/30] reinstate the format string unsigned int] --- hud.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hud.lua b/hud.lua index 4ef96f4..ce83660 100644 --- a/hud.lua +++ b/hud.lua @@ -9,7 +9,7 @@ minetest.register_globalstep(function(dtime) local areaStrings = {} for id, area in pairs(areas:getAreasAtPos(pos)) do - table.insert(areaStrings, ("%s [%i] (%s%s)") + table.insert(areaStrings, ("%s [%u] (%s%s)") :format(area.name, id, area.owner, area.open and ":open" or "")) end From bb10d0c9f3a9cd5a9a0ced46c729e765cfe4e3d9 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Mon, 28 Nov 2016 22:38:14 +0800 Subject: [PATCH 15/30] reverting auth change --- internal.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal.lua b/internal.lua index 05a31cd..bf7e92c 100644 --- a/internal.lua +++ b/internal.lua @@ -1,6 +1,6 @@ function areas:player_exists(name) - return minetest.auth_table[name] ~= nil + return minetest.get_auth_handler().get_auth(name) ~= nil end -- Save the areas table to a file From 9fc3583509079ff009163b1dbc5e7c72ee8ffbd5 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Mon, 28 Nov 2016 22:40:00 +0800 Subject: [PATCH 16/30] restore code style, adjust further style --- api.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/api.lua b/api.lua index fc9d41c..49478e0 100644 --- a/api.lua +++ b/api.lua @@ -1,7 +1,7 @@ local protection_detectors = {} -- Other protection mods should be able to display their protection in the hud -areas.register_hud_handler = function(handler) +areas.registerHudHandler = function(handler) protection_detectors[#protection_detectors + 1] = handler end @@ -20,7 +20,7 @@ end function areas:getRegisteredProtections(pos) local res = {} - res = detect_extra_protection(pos,res) + res = detect_extra_protection(pos, res) return res end @@ -39,10 +39,9 @@ function areas:getAreasAtPos(pos) for id, area in pairs(self.areas) do local ap1, ap2 = area.pos1, area.pos2 if - (px >= ap1.x and px <= ap2.x) and - (py >= ap1.y and py <= ap2.y) and - (pz >= ap1.z and pz <= ap2.z) - then + (px >= ap1.x and px <= ap2.x) and + (py >= ap1.y and py <= ap2.y) and + (pz >= ap1.z and pz <= ap2.z) then res[id] = area end end From ea0d14d31297e5c22792807beed0be011747d640 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Mon, 28 Nov 2016 22:51:47 +0800 Subject: [PATCH 17/30] added space for stylistic imrpovement --- api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.lua b/api.lua index 49478e0..198979a 100644 --- a/api.lua +++ b/api.lua @@ -6,7 +6,7 @@ areas.registerHudHandler = function(handler) end -- Generalized call to registered handlers to add their proeciton labels to the areas list -local detect_extra_protection = function(pos,area_list) +local detect_extra_protection = function(pos, area_list) if #protection_detectors <= 0 then return area_list end From 5349738fc6b5501b483906573a89488341c56630 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Mon, 19 Dec 2016 16:40:42 +0000 Subject: [PATCH 18/30] stylistic fixes etc --- api.lua | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/api.lua b/api.lua index 198979a..102716d 100644 --- a/api.lua +++ b/api.lua @@ -6,24 +6,19 @@ areas.registerHudHandler = function(handler) end -- Generalized call to registered handlers to add their proeciton labels to the areas list -local detect_extra_protection = function(pos, area_list) +function areas:getRegisteredProtections(pos) + local area_list = {} if #protection_detectors <= 0 then return area_list end - for idx=1,#protection_detectors do + for idx=1, #protection_detectors do local func = protection_detectors[idx] - area_list = func(pos,area_list) + area_list = func(pos, area_list) end return area_list end -function areas:getRegisteredProtections(pos) - local res = {} - res = detect_extra_protection(pos, res) - return res -end - --- Returns a list of areas that include the provided position. function areas:getAreasAtPos(pos) local res = {} From ebc6f8b11b7cceb1bef445521e8b289452a63f52 Mon Sep 17 00:00:00 2001 From: anonymous Date: Mon, 2 Oct 2017 03:14:16 +0100 Subject: [PATCH 19/30] Cleaning up deprecated calls. --- init.lua | 2 +- settings.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 2c10cdd..d1b7ebe 100644 --- a/init.lua +++ b/init.lua @@ -32,7 +32,7 @@ if not minetest.registered_privileges[areas.config.self_protection_privilege] th }) end -if minetest.setting_getbool("log_mod") then +if minetest.settings:get_bool("log_mod") then local diffTime = os.clock() - areas.startTime minetest.log("action", "areas loaded in "..diffTime.."s.") end diff --git a/settings.lua b/settings.lua index 140a655..ffb5355 100644 --- a/settings.lua +++ b/settings.lua @@ -6,13 +6,13 @@ local function setting(tp, name, default) local full_name = "areas."..name local value if tp == "boolean" then - value = minetest.setting_getbool(full_name) + value = minetest.settings:get_bool(full_name) elseif tp == "string" then - value = minetest.setting_get(full_name) + value = minetest.settings:get(full_name) elseif tp == "position" then value = minetest.setting_get_pos(full_name) elseif tp == "number" then - value = tonumber(minetest.setting_get(full_name)) + value = tonumber(minetest.settings:get(full_name)) else error("Invalid setting type!") end From d90fa7355c8b94c2ba9f708f9dd282d2c5f6a418 Mon Sep 17 00:00:00 2001 From: red-001 Date: Sun, 4 Feb 2018 16:30:41 +0000 Subject: [PATCH 20/30] Use the new `minetest.safe_file_write` API if possible when saving database. --- internal.lua | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/internal.lua b/internal.lua index bf7e92c..e106398 100644 --- a/internal.lua +++ b/internal.lua @@ -3,6 +3,18 @@ function areas:player_exists(name) return minetest.get_auth_handler().get_auth(name) ~= nil end +local safe_file_write = minetest.safe_file_write +if safe_file_write == nil then + function safe_file_write(path, content) + local file, err = io.open(path, "w") + if err then + return err + end + file:write(content) + file:close() + end +end + -- Save the areas table to a file function areas:save() local datastr = minetest.serialize(self.areas) @@ -10,12 +22,7 @@ function areas:save() minetest.log("error", "[areas] Failed to serialize area data!") return end - local file, err = io.open(self.config.filename, "w") - if err then - return err - end - file:write(datastr) - file:close() + return safe_file_write(self.config.filename, datastr) end -- Load the areas table from the save file From 6cad881b6ff0cb5c67cabdca77ec06ba9f65ccfe Mon Sep 17 00:00:00 2001 From: alexerate <35458285+alexerate@users.noreply.github.com> Date: Mon, 5 Feb 2018 18:17:53 +0100 Subject: [PATCH 21/30] update player location update player location when protected --- interact.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interact.lua b/interact.lua index 2e54800..a0579d1 100644 --- a/interact.lua +++ b/interact.lua @@ -1,7 +1,10 @@ local old_is_protected = minetest.is_protected function minetest.is_protected(pos, name) + local player = minetest.get_player_by_name(name) + local playerpos = player:getpos() if not areas:canInteract(pos, name) then + player:setpos(playerpos) return true end return old_is_protected(pos, name) From b0de983ffbfd93eabfae15e394f4246b0b515181 Mon Sep 17 00:00:00 2001 From: alexerate <35458285+alexerate@users.noreply.github.com> Date: Mon, 5 Feb 2018 23:49:18 +0100 Subject: [PATCH 22/30] function anti_lag added --- interact.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/interact.lua b/interact.lua index a0579d1..fc982a4 100644 --- a/interact.lua +++ b/interact.lua @@ -1,22 +1,26 @@ local old_is_protected = minetest.is_protected function minetest.is_protected(pos, name) - local player = minetest.get_player_by_name(name) - local playerpos = player:getpos() if not areas:canInteract(pos, name) then - player:setpos(playerpos) return true end return old_is_protected(pos, name) end minetest.register_on_protection_violation(function(pos, name) + local player = minetest.get_player_by_name(name) + local playerpos = player:getpos() if not areas:canInteract(pos, name) then local owners = areas:getNodeOwners(pos) minetest.chat_send_player(name, ("%s is protected by %s."):format( minetest.pos_to_string(pos), table.concat(owners, ", "))) + --minetest.after(1,anti_lag,{player=player,playerpos=playerpos}) + player:setpos(playerpos) end end) +function anti_lag(player) + player.player:setpos(player.playerpos) +end \ No newline at end of file From 0b96f75d6588ea234dffb8c4fff9de3c207f0a94 Mon Sep 17 00:00:00 2001 From: alexerate <35458285+alexerate@users.noreply.github.com> Date: Mon, 5 Feb 2018 23:52:01 +0100 Subject: [PATCH 23/30] Add delay for anti_lag --- interact.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interact.lua b/interact.lua index fc982a4..7871198 100644 --- a/interact.lua +++ b/interact.lua @@ -16,8 +16,8 @@ minetest.register_on_protection_violation(function(pos, name) ("%s is protected by %s."):format( minetest.pos_to_string(pos), table.concat(owners, ", "))) - --minetest.after(1,anti_lag,{player=player,playerpos=playerpos}) - player:setpos(playerpos) + minetest.after(1,anti_lag,{player=player,playerpos=playerpos}) + --player:setpos(playerpos) end end) From 599d9350bb4c682d7e0e9aa9d6b66e0e0d932069 Mon Sep 17 00:00:00 2001 From: alexerate <35458285+alexerate@users.noreply.github.com> Date: Tue, 6 Feb 2018 14:02:07 +0100 Subject: [PATCH 24/30] remove obsolet code --- interact.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/interact.lua b/interact.lua index 7871198..9a457d2 100644 --- a/interact.lua +++ b/interact.lua @@ -17,10 +17,9 @@ minetest.register_on_protection_violation(function(pos, name) minetest.pos_to_string(pos), table.concat(owners, ", "))) minetest.after(1,anti_lag,{player=player,playerpos=playerpos}) - --player:setpos(playerpos) end end) function anti_lag(player) player.player:setpos(player.playerpos) -end \ No newline at end of file +end From 52011bdfa433ceefc2b2e6beca110aa57603d5c1 Mon Sep 17 00:00:00 2001 From: alexerate <35458285+alexerate@users.noreply.github.com> Date: Tue, 6 Feb 2018 15:15:32 +0100 Subject: [PATCH 25/30] localisation --- interact.lua | 8 ++++---- intllib.lua | 45 +++++++++++++++++++++++++++++++++++++++++++++ locale/fr.po | 23 +++++++++++++++++++++++ 3 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 intllib.lua create mode 100644 locale/fr.po diff --git a/interact.lua b/interact.lua index 9a457d2..78a1f6f 100644 --- a/interact.lua +++ b/interact.lua @@ -1,3 +1,5 @@ +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") local old_is_protected = minetest.is_protected function minetest.is_protected(pos, name) @@ -12,10 +14,8 @@ minetest.register_on_protection_violation(function(pos, name) local playerpos = player:getpos() if not areas:canInteract(pos, name) then local owners = areas:getNodeOwners(pos) - minetest.chat_send_player(name, - ("%s is protected by %s."):format( - minetest.pos_to_string(pos), - table.concat(owners, ", "))) + --minetest.chat_send_player(name, ("%s is protected by %s."):format(minetest.pos_to_string(pos), table.concat(owners, ", "))) + minetest.chat_send_player(name,S("@1 is protected by @2",minetest.pos_to_string(pos),table.concat(owners, ", "))) minetest.after(1,anti_lag,{player=player,playerpos=playerpos}) end end) diff --git a/intllib.lua b/intllib.lua new file mode 100644 index 0000000..6669d72 --- /dev/null +++ b/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/locale/fr.po b/locale/fr.po new file mode 100644 index 0000000..b0dde4b --- /dev/null +++ b/locale/fr.po @@ -0,0 +1,23 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-29 11:28+0200\n" +"PO-Revision-Date: 2018-01-29 09:18+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.12\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: init.lua +msgid "@1 is protected by @2" +msgstr "@1 est protg par @2" From a9b954399e4a772bb99e7ff6955ca0d8fec09660 Mon Sep 17 00:00:00 2001 From: alexerate <35458285+alexerate@users.noreply.github.com> Date: Tue, 6 Feb 2018 20:23:17 +0100 Subject: [PATCH 26/30] utf-8 --- locale/fr.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/fr.po b/locale/fr.po index b0dde4b..72aa30a 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -20,4 +20,4 @@ msgstr "" #: init.lua msgid "@1 is protected by @2" -msgstr "@1 est protg par @2" +msgstr "@1 est protégé par @2" From 93df2f360522519a5be066f66ead0687b0512c3e Mon Sep 17 00:00:00 2001 From: alexerate <35458285+alexerate@users.noreply.github.com> Date: Wed, 7 Feb 2018 18:07:40 +0100 Subject: [PATCH 27/30] make self_protection true by default --- settings.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/settings.lua b/settings.lua index ffb5355..6a11e67 100644 --- a/settings.lua +++ b/settings.lua @@ -30,7 +30,7 @@ setting("string", "filename", world_path.."/areas.dat") -- Allow players with a privilege create their own areas -- within the maximum size and number. -setting("boolean", "self_protection", false) +setting("boolean", "self_protection", true) setting("string", "self_protection_privilege", "interact") setting("position", "self_protection_max_size", {x=64, y=128, z=64}) setting("number", "self_protection_max_areas", 4) @@ -40,4 +40,3 @@ setting("number", "self_protection_max_areas_high", 32) -- legacy_table (owner_defs) compatibility. Untested and has known issues. setting("boolean", "legacy_table", false) - From a23d2bad3aa9419741bd36aeb03cf5da376f41d5 Mon Sep 17 00:00:00 2001 From: "Muhammad Nur Hidayat Yasuyoshi (MNH48.com)" Date: Sat, 17 Feb 2018 01:34:29 +0800 Subject: [PATCH 28/30] Manual update due to conflict This adds part of PR #4 and they came from inpos/areas repo, author for the changes is ElementW. --- api.lua | 108 ++++++++++++++++++++++++++++++++++++ chatcommands.lua | 77 +++++++++++++++++++++++++ hud.lua | 84 ++++++++++++++++++++-------- internal.lua | 53 ++++++++++-------- textures/areas_0_0_0.png | Bin 0 -> 275 bytes textures/areas_0_0_1.png | Bin 0 -> 440 bytes textures/areas_0_1_0.png | Bin 0 -> 437 bytes textures/areas_0_1_1.png | Bin 0 -> 437 bytes textures/areas_1_0_0.png | Bin 0 -> 341 bytes textures/areas_1_0_1.png | Bin 0 -> 491 bytes textures/areas_1_1_0.png | Bin 0 -> 278 bytes textures/areas_1_1_1.png | Bin 0 -> 495 bytes textures/areas_not_area.png | Bin 0 -> 288 bytes 13 files changed, 276 insertions(+), 46 deletions(-) create mode 100644 textures/areas_0_0_0.png create mode 100644 textures/areas_0_0_1.png create mode 100644 textures/areas_0_1_0.png create mode 100644 textures/areas_0_1_1.png create mode 100644 textures/areas_1_0_0.png create mode 100644 textures/areas_1_0_1.png create mode 100644 textures/areas_1_1_0.png create mode 100644 textures/areas_1_1_1.png create mode 100644 textures/areas_not_area.png diff --git a/api.lua b/api.lua index c379b3d..bb5bd7a 100644 --- a/api.lua +++ b/api.lua @@ -14,6 +14,13 @@ function areas:getExternalHudEntries(pos) return areas end +--plants to place in openfarming +local plants = { ["farming:blueberries"]="air", ["farming:carrot"]="air", ["farming:coffee_beans"]="air", ["farming:corn"]="air", ["farming:cucumber"]="air", + ["farming:melon_slice"]="air", ["farming:potato"]="air", ["farming:pumpkin_slice"]="air", ["farming:raspberries"]="air", ["farming:rhubarb"]="air", + ["farming:tomato"]="air", ["farming:seed_cotton"]="air", ["farming:seed_wheat"]="air",["default:papyrus"]="air", ["farming:trellis"]="air", + ["farming:grapes"]="farming:trellis", ["farming:beanpole"]="air", ["farming:beans"]="farming:beanpole", + } + --- Returns a list of areas that include the provided position. function areas:getAreasAtPos(pos) local res = {} @@ -73,9 +80,42 @@ function areas:canInteract(pos, name) return true end local owned = false + + -- to avoid crash with water lily + if pos == nil then + return not owned + end + for _, area in pairs(self:getAreasAtPos(pos)) do if area.owner == name or area.open then return true + + elseif area.openfarming then + -- if area is openfarming + local node = minetest.get_node(pos).name + if not minetest.registered_nodes[node] then + return false + end + local player = minetest.get_player_by_name(name) + if not player then + return false + end + local wstack = player:get_wielded_item():get_name() + if wstack == "" then + wstack = "hand" + end + + --on_dig + if minetest.get_item_group(node, "plant") == 1 and (wstack == "hand" or minetest.registered_tools[wstack]) then + return true + end + + --on_place + if plants[wstack] ~= nil and plants[wstack] == node then + return true + end + + owned = true else owned = true end @@ -83,6 +123,74 @@ function areas:canInteract(pos, name) return not owned end +function areas:canMakeArea(pos1, pos2, name) --MFF crabman(25/02/2016) fix areas in areas + if name and minetest.check_player_privs(name, self.adminPrivs) then + return true + end + areas:sortPos(pos1, pos2) + + local id_areas_intersect = {} + local areas = self:getAreasIntersectingArea(pos1, pos2) + + if not areas then return true end + + for id, area in pairs(areas) do + if area.owner == name and self:isSubarea(pos1, pos2, id) then + return true + end + if not area.open and not self:isAreaOwner(id, name) then + table.insert(id_areas_intersect, id) + end + end + + if #id_areas_intersect > 0 then + return false, id_areas_intersect[1] + end + + return true +end + + +--MFF crabman(5/03/2016 ) return special area pos if a spawn is set. +--1 party (2 party in beds mod) +function areas:getSpawn(pos) + for _, area in pairs(areas:getAreasAtPos(pos)) do + if area.spawn and area.spawn.x then + return area.spawn + end + end + return nil +end + +--MFF DEBUT crabman(17/09/2015 ) respawn player in special area(event) if a spawn is set. +--1 party (2 party in beds mod) +local dead_players = {} +minetest.register_on_dieplayer(function(player) + local player_name = player:get_player_name() + if not player_name then return end + local pos = player:getpos() + if pos then + dead_players[player_name] = pos + end +end) + + +function areas:onRespawn(player) + local player_name = player:get_player_name() + if not player_name or not dead_players[player_name] then return false end + local pos = dead_players[player_name] + dead_players[player_name] = nil + if pos then + for _, area in pairs(areas:getAreasAtPos(pos)) do + if area.spawn then + player:setpos(area.spawn) + return true + end + end + end + return false +end + -- Returns a table (list) of all players that own an area function areas:getNodeOwners(pos) local owners = {} diff --git a/chatcommands.lua b/chatcommands.lua index 6079e93..b891e08 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -285,6 +285,26 @@ minetest.register_chatcommand("area_open", { end }) +minetest.register_chatcommand("area_openfarming", { + params = "", + description = "Toggle an area open (anyone can interact farming) or closed", + func = function(name, param) + local id = tonumber(param) + if not id then + return false, "Invalid usage, see /help area_openfarming." + end + + if not areas:isAreaOwner(id, name) then + return false, "Area "..id.." does not exist" + .." or is not owned by you." + end + local openfarming = not areas.areas[id].openfarming + -- Save false as nil to avoid inflating the DB. + areas.areas[id].openfarming = openfarming or nil + areas:save() + return true, ("Area %s to farming."):format(openfarming and "opened" or "closed") + end +}) minetest.register_chatcommand("move_area", { params = "", @@ -403,3 +423,60 @@ minetest.register_chatcommand("area_info", { end, }) +--MFF DEBUT crabman(17/09/2015 ) respawn player at in special area(event) if a spawn is set. ++minetest.register_chatcommand("area_addspawn", { + params = "", + privs = areas.adminPrivs, + description = "Define special spawn for area", + func = function(name, param) + local id = param:match("^(%d+)") + if not id then + return false, "Invalid usage, see /help area_addspawn." + end + + id = tonumber(id) + if not id then + return false, "Error, Param id must be int." + end + + local player = minetest.get_player_by_name(name) + if not player then + return false, "Error, there is not player" + end + local pos = player:getpos() + if not pos then + return false, "Error, there is not pos." + end + + if not areas.areas[id] then + return false, "Area ".. id .." does not exist." + end + areas.areas[id].spawn = pos + areas:save() + return true, "spawn of area ".. id .." defined." + end +}) + +minetest.register_chatcommand("area_delspawn", { + params = "", + privs = areas.adminPrivs, + description = "Delete special spawn of area", + func = function(name, param) + local id = param:match("^(%d+)") + if not id then + return false, "Invalid usage, see /help area_delspawn." + end + + id = tonumber(id) + if not id then + return false, "Error, Param id must be int." + end + + if not areas.areas[id] then + return false, "Area ".. id .." does not exist." + end + areas.areas[id].spawn = nil + areas:save() + return true, "spawn of area ".. id .." deleted." + end +}) diff --git a/hud.lua b/hud.lua index 0b7931f..b8b4850 100644 --- a/hud.lua +++ b/hud.lua @@ -2,16 +2,35 @@ areas.hud = {} -minetest.register_globalstep(function(dtime) +local function tick() for _, player in pairs(minetest.get_connected_players()) do local name = player:get_player_name() local pos = vector.round(player:getpos()) - local areaStrings = {} + local area_text = "No area(s)\n\n" + local area_owner_name = "" + local mod_owner = 0 + local mod_open = 0 + local mod_farming = 0 + local area_name = "" + local nb_areas = 0 for id, area in pairs(areas:getAreasAtPos(pos)) do - table.insert(areaStrings, ("%s [%u] (%s%s)") - :format(area.name, id, area.owner, - area.open and ":open" or "")) + nb_areas = nb_areas+1 + if areas:isAreaOwner(id, name) then + mod_owner = 1 + end + + if area.open then + mod_open = 1 + end + if area.openfarming then + mod_farming = 1 + end + + if not area.parent then + area_owner_name = area.owner + area_name = area.name + end end for i, area in pairs(areas:getExternalHudEntries(pos)) do @@ -22,33 +41,52 @@ minetest.register_globalstep(function(dtime) table.insert(areaStrings, str) end - local areaString = "Areas:" - if #areaStrings > 0 then - areaString = areaString.."\n".. - table.concat(areaStrings, "\n") + local icon = "areas_not_area.png" + if nb_areas > 0 then + local plural = "" + if nb_areas > 1 then + plural = "s" + end + area_text = ("%s\nOwner: %s\n%u area" .. plural):format(area_name, area_owner_name, nb_areas) + icon = ("areas_%u_%u_%u.png"):format(mod_owner, mod_open, mod_farming) end - local hud = areas.hud[name] - if not hud then - hud = {} - areas.hud[name] = hud - hud.areasId = player:hud_add({ + if not areas.hud[name] then + areas.hud[name] = {} + areas.hud[name].icon = player:hud_add({ + hud_elem_type = "image", + position = {x=0,y=1}, + scale = {x=1,y=1}, + offset = {x=26,y=-60}, + text = icon, + }) + + areas.hud[name].areas_id = player:hud_add({ hud_elem_type = "text", name = "Areas", number = 0xFFFFFF, position = {x=0, y=1}, - offset = {x=8, y=-8}, - text = areaString, - scale = {x=200, y=60}, + offset = {x=48, y=-40}, + text = area_text, + scale = {x=1, y=1}, alignment = {x=1, y=-1}, }) - hud.oldAreas = areaString - return - elseif hud.oldAreas ~= areaString then - player:hud_change(hud.areasId, "text", areaString) - hud.oldAreas = areaString + areas.hud[name].old_area_text = area_text + areas.hud[name].old_icon = icon + else + if areas.hud[name].old_area_text ~= area_text then + player:hud_change(areas.hud[name].areas_id, "text", area_text) + areas.hud[name].old_area_text = area_text + end + if areas.hud[name].old_icon ~= icon then + player:hud_change(areas.hud[name].icon, "text", icon) + areas.hud[name].old_icon = icon + end end end -end) + minetest.after(1.5, tick) +end + +tick() minetest.register_on_leaveplayer(function(player) areas.hud[player:get_player_name()] = nil diff --git a/internal.lua b/internal.lua index e106398..664c558 100644 --- a/internal.lua +++ b/internal.lua @@ -1,3 +1,5 @@ +-- Mega_builder privilege +minetest.register_privilege("megabuilder","Can protect an infinite amount of areas.") function areas:player_exists(name) return minetest.get_auth_handler().get_auth(name) ~= nil @@ -202,33 +204,38 @@ function areas:canPlayerAddArea(pos1, pos2, name) .." the necessary privilege." end - local max_size = privs.areas_high_limit and - self.config.self_protection_max_size_high or - self.config.self_protection_max_size - if - (pos2.x - pos1.x) > max_size.x or - (pos2.y - pos1.y) > max_size.y or - (pos2.z - pos1.z) > max_size.z then - return false, "Area is too big." - end - - -- Check number of areas the user has and make sure it not above the max - local count = 0 - for _, area in pairs(self.areas) do - if area.owner == name then - count = count + 1 + -- MFF: megabuilders skip checks on size and number of areas. + if not privs["megabuilder"] then + -- Check size + local max_size = privs.areas_high_limit and + self.config.self_protection_max_size_high or + self.config.self_protection_max_size + if + (pos2.x - pos1.x) > max_size.x or + (pos2.y - pos1.y) > max_size.y or + (pos2.z - pos1.z) > max_size.z then + return false, "Area is too big." + end + + -- Check number of areas the user has and make sure it not above the max + local count = 0 + for _, area in pairs(self.areas) do + if area.owner == name then + count = count + 1 + end + end + local max_areas = privs.areas_high_limit and + self.config.self_protection_max_areas_high or + self.config.self_protection_max_areas + if count >= max_areas then + return false, "You have reached the maximum amount of" + .." areas that you are allowed to protect." end end - local max_areas = privs.areas_high_limit and - self.config.self_protection_max_areas_high or - self.config.self_protection_max_areas - if count >= max_areas then - return false, "You have reached the maximum amount of" - .." areas that you are allowed to protect." - end +end -- Check intersecting areas - local can, id = self:canInteractInArea(pos1, pos2, name) + local can, id = self:canMakeArea(pos1, pos2, name) --MFF crabman(25/02/2016) fix areas in areas if not can then local area = self.areas[id] return false, ("The area intersects with %s [%u] (%s).") diff --git a/textures/areas_0_0_0.png b/textures/areas_0_0_0.png new file mode 100644 index 0000000000000000000000000000000000000000..dbdabc2cc524ff5e763a187eefbadca96c2bd8b4 GIT binary patch literal 275 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!Bm#UwT!A!00|P@N149!7Lo)+I z8%W?k1H*E=IcI<@wvr&fV2}_4L*6p>i9l+Jr;B4q#NoHsE^;*+@UUJGJO1ha{AzU* z;Wf>(p5OZ1dz4P;h8Cpi%H`^`Gba&3<1fDL*CbEZ6NAa(6lp O$lacEe*gdg26R$RQvd(}0001PrU#J#009t5 zL_t(o!|m5=3xY5d2H_!p2W6Y*ar2C+44#EG z^zrgUZUC><$Qt194P*syMH^WFTzxH>0+0BOl*KW~S5F3y25__hAAQVt0GiGo=z$*S0VTkVz6j{|fn7uF z!U$Ms<9Bv|$Onjo#JDryUeYi^CP(f7kRb}vEApu;P>cf61!>$NfWt7rb?got2VzpD z!U;&gPII3u_yP%oh&>ik!USUXl~@e_b$bV(HvBGt`uwedV*c68XG7ToGjs}g?1{d+ i@}Ixj)PGd6@sb-powz~Qr94*v0000Y%zSjZtKzi|8tjb+qGuuvP-RDn;m{;6l?D-lzAX%%QIm@MWFxOygV897k-`1 zjDO`GC^$qX$uMM8M}K3L`}_SEgTU8qy6=1BFMPAVGjHP0Wun>g2WHunyPY)t>35LP zpyqK|!`%7P+8KKD8Q#o`b#6Gu@FCFs9&DQ$J>|a9Drbonh|7e#Vmf_7VXL_IO1GummKAC?xv_NRlfC(W c;LLk!zopr0JTc53jhEB literal 0 HcmV?d00001 diff --git a/textures/areas_0_1_1.png b/textures/areas_0_1_1.png new file mode 100644 index 0000000000000000000000000000000000000000..e787507b21631077537d4c9242ba5fcbbc7d80e2 GIT binary patch literal 437 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!LIQk3T!A!00|P@N149!7Lo)+I z8%O{sVkpOJsK{rgBw(#7V67?QtS|1SE9!5`8)zw$<0-s%@7^Y%zSjZtKzi|8tjb+qGuuvP-RDn;m{;6l?D-lzAX%%QIm@MWFxOygV897k-`1 zjDO`GC^$qX$uMM8M}K3L`}_SEgTU8qy6=1BFMPAVGjHP0Wun>g2WHunyPY)t>35LP zpyqK|!`%7P+8KKD8Q#o`b#6Gu@FCFs9&DQ$J>|a9Drbonh|7e#Vmf_7VXL_IO1GummKAC?xv_NRlfC(W c;LLk!zopr0JTc53jhEB literal 0 HcmV?d00001 diff --git a/textures/areas_1_0_0.png b/textures/areas_1_0_0.png new file mode 100644 index 0000000000000000000000000000000000000000..6b910ffc47c9f5ff5ff9a9702e505f14d9a3e88a GIT binary patch literal 341 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!oC178T!A!00|P@N149!7Lo)+I z8<-0efioboKoX9Cih-aWs&PicIUgWbs3gcQ7%aiS#3d{yp%DA=$De=ym`rulfT9~b zT^vIq4!@lm$=7Va*`hz`!KXz;L5sb^OyK^|^f_TJt_J_CGC;ZK{6|3i6SstDnm{r-UW|nN@ap literal 0 HcmV?d00001 diff --git a/textures/areas_1_0_1.png b/textures/areas_1_0_1.png new file mode 100644 index 0000000000000000000000000000000000000000..a5d73e2cbe5e1bc838b9dad6d1af887d5d919a93 GIT binary patch literal 491 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!ssnsNT!A!00|P@N149!7Lo)+I z8<-0efioboKoX9Cih-aWs?ku6*HDqqOi936Rlr(P#93e5O;^<4lsC{)CdX5F@7}#< z&YXGl=+WcHkDonz_Wu3*&!0bk|Ni~||Nqn89<>6RBUBRP7YsI$fr(34OhO^{BhD02GJ2g|dNkO1(>)}n8i*#Q)T;TivU*E^a{cQ4qxkXa7`xSrN zz1hSu>znJrXx+QUCo&hlyU#Iyt|E`=Zz-=^nqu>H=ACAowrV!Ja%|7BDywT#|9ms~ zZRFV*^e;5@^Q5elKWRDlx7iDqHipGa*Kuh5BdO*!H~g#wLm$tAI?0thkItH{e$FH5 zlzfIkVDh;Q?Em>U)J<-@`&qAHN)^Kma}U0N{o9ldr0@Ixq^Fc!AZfe77fU9F13#6Y zOo@wPUZitlZt*2m20tAR38sR5a+AZhFa^Al4TwF!wBoto8OKF(iXD?Bmii0W2OIv? zV>tS2Dr4YZy;n|!vEsW}72dhLS$pU6^0g|lD=eR|-qNpjyKBuM1PU%sS3j3^P6C0PB9$YRfs;Ylz>@eSL2HO|Y22F>#5^4-zpD*Id`MP>$ zht6N4W8teA7w=o&f1*+{X+1;U=SO|pl0G{tGALZ#!LJY#mC|s^oZ-lBZRQZ62fEi! z$qT4(3Me=nVBJ!peBeFvw7cm+4@9n&GqG?8C>U_d*iQZb=lV1KS#SMzGP*i+I|e2& QodLPr)78&qol`;+0CR?8F8}}l literal 0 HcmV?d00001 diff --git a/textures/areas_1_1_1.png b/textures/areas_1_1_1.png new file mode 100644 index 0000000000000000000000000000000000000000..44a6dc03d080f6aeb9e05813ddc5968fb0794f34 GIT binary patch literal 495 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!>H>U1T!A!00|P@N149!7Lo)+I z8<-0efioboKoX9Cih-aWs?ku6*HDqqOi936Rlr(P#93e5O;^<4lsC{)CdX5F@7}#< z&YXGl=+WcHkDonz_Wu3*PxBc*fByXa`}hC<|8Iysz6ofQP)U$qFxXHACN5zy35D2? zKmPpt$7HIb#=yYH=jq}Y5^?zL)Yn2y3IeTLyHmrxbzU|taQ*pDf5wcyS<@NIPi21j z4vAlIxy>d-io57Vg*&&zwHvUNY7{iyba#v->lJ1KU{>OJs zx<4;1UQILb)c#djaY4O3_j}&n{+7N-??Tt>Nvta-*dKOT`FWKjv!Xj&!2X^PwvTDE zuNJrQEHq4G=^CF!Wa}DpPHq6fu2w-?nW2?3{gH_>(b;B+OR)O<}Cp5d*^f0O$ddV}_ zElc_p%h2^zn|aZ%*bA+XcImwrW7r|QaC_1D`P(LyEPOUWe24aIk!?%cwLszJ>FVdQ I&MBb@0IEI2KL7v# literal 0 HcmV?d00001 diff --git a/textures/areas_not_area.png b/textures/areas_not_area.png new file mode 100644 index 0000000000000000000000000000000000000000..1c4c7790e2c8316f3ae1d8ba652745743180b7dd GIT binary patch literal 288 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!L<4+6T!A!0Jp)4n14APNLlXl- zGXp~#1OKZ2=|FMzk|4iekOCkGO?edoq&9oHIEF+VemmWpui1dd#ai#q|9u`k+Fq>= zXI1=enx128eeitaT=|MSIV*Z@{(F$mu=~pm-iq7Sw>Vhtyq8}m%V0fczUdU#1&`$S z&GcC#wBSu`T%Y;pRfm7D+3bDrR#=3YA+W|$ouy&XIyshrWz%#Uau@n}OET~?d|9)( zgDLprG(!a)2Od6ljVp$eXE1D)YCqT5n#b~|o*{brJT-^c2~0v08dy{oh!>QH%l*mV d{ Date: Sat, 17 Feb 2018 02:18:30 +0800 Subject: [PATCH 29/30] Manual update due to conflict (part 2) This adds part of PR #4 and they came from inpos/areas repo, this adds i18n : intllib po/pot method and french translation. Author is fat115 --- chatcommands.lua | 210 +++++++++--------- depends.txt | 1 + hud.lua | 6 +- init.lua | 13 +- interact.lua | 7 +- internal.lua | 22 +- legacy.lua | 22 +- locale/fr.po | 507 +++++++++++++++++++++++++++++++++++++++++++- locale/template.pot | 496 +++++++++++++++++++++++++++++++++++++++++++ pos.lua | 53 ++--- settings.lua | 3 +- 11 files changed, 1172 insertions(+), 168 deletions(-) create mode 100644 depends.txt create mode 100644 locale/template.pot diff --git a/chatcommands.lua b/chatcommands.lua index b891e08..1632fe5 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -1,59 +1,59 @@ +local S = areas.intllib minetest.register_chatcommand("protect", { params = "", - description = "Protect your own area", + description = S("Protect your own area"), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) if param == "" then - return false, "Invalid usage, see /help protect." + return false, S("Invalid usage, see /help protect.") end local pos1, pos2 = areas:getPos(name) if not (pos1 and pos2) then - return false, "You need to select an area first." + return false, S("You need to select an area first.") end - minetest.log("action", "/protect invoked, owner="..name.. + minetest.log("action", S("/protect invoked, Owner =")..name.. " AreaName="..param.. " StartPos="..minetest.pos_to_string(pos1).. " EndPos=" ..minetest.pos_to_string(pos2)) local canAdd, errMsg = areas:canPlayerAddArea(pos1, pos2, name) if not canAdd then - return false, "You can't protect that area: "..errMsg + return false, S("You can't protect that area: ")..errMsg end local id = areas:add(name, param, pos1, pos2, nil) areas:save() - return true, "Area protected. ID: "..id + return true, S("Area protected. ID: ")..id end }) minetest.register_chatcommand("set_owner", { params = " ", - description = "Protect an area beetween two positions and give" + description = S("Protect an area beetween two positions and give" .." a player access to it without setting the parent of the" - .." area to any existing area", + .." area to any existing area"), privs = areas.adminPrivs, func = function(name, param) local ownerName, areaName = param:match('^(%S+)%s(.+)$') if not ownerName then - return false, "Incorrect usage, see /help set_owner." + return false, S("Incorrect usage, see /help set_owner.") end local pos1, pos2 = areas:getPos(name) if not (pos1 and pos2) then - return false, "You need to select an area first." + return false, S("You need to select an area first.") end if not areas:player_exists(ownerName) then - return false, "The player \"" - ..ownerName.."\" does not exist." + return false, S("The player \"@1\" does not exist.", ownerName) end - minetest.log("action", name.." runs /set_owner. Owner = "..ownerName.. + minetest.log("action", name..S(" runs /set_owner. Owner = ")..ownerName.. " AreaName = "..areaName.. " StartPos = "..minetest.pos_to_string(pos1).. " EndPos = " ..minetest.pos_to_string(pos2)) @@ -62,37 +62,36 @@ minetest.register_chatcommand("set_owner", { areas:save() minetest.chat_send_player(ownerName, - "You have been granted control over area #".. - id..". Type /list_areas to show your areas.") - return true, "Area protected. ID: "..id + S("You have been granted control over area #@1. Type /list_areas to show your areas.", id)) + return true, S("Area protected. ID: ")..id end }) minetest.register_chatcommand("add_owner", { params = " ", - description = "Give a player access to a sub-area beetween two" + description = S("Give a player access to a sub-area beetween two" .." positions that have already been protected," - .." Use set_owner if you don't want the parent to be set.", + .." Use set_owner if you don't want the parent to be set."), func = function(name, param) local pid, ownerName, areaName = param:match('^(%d+) ([^ ]+) (.+)$') if not pid then - minetest.chat_send_player(name, "Incorrect usage, see /help add_owner") + minetest.chat_send_player(name, S("Incorrect usage, see /help add_owner")) return end local pos1, pos2 = areas:getPos(name) if not (pos1 and pos2) then - return false, "You need to select an area first." + return false, S("You need to select an area first.") end if not areas:player_exists(ownerName) then - return false, "The player \""..ownerName.."\" does not exist." + return false, S("The player \"@1\" does not exist.", ownerName) end - minetest.log("action", name.." runs /add_owner. Owner = "..ownerName.. + minetest.log("action", name..S(" runs /add_owner. Owner = ")..ownerName.. " AreaName = "..areaName.." ParentID = "..pid.. " StartPos = "..pos1.x..","..pos1.y..","..pos1.z.. " EndPos = " ..pos2.x..","..pos2.y..","..pos2.z) @@ -101,52 +100,51 @@ minetest.register_chatcommand("add_owner", { pid = tonumber(pid) if (not areas:isAreaOwner(pid, name)) or (not areas:isSubarea(pos1, pos2, pid)) then - return false, "You can't protect that area." + return false, S("You can't protect that area.") end local id = areas:add(ownerName, areaName, pos1, pos2, pid) areas:save() minetest.chat_send_player(ownerName, - "You have been granted control over area #".. - id..". Type /list_areas to show your areas.") - return true, "Area protected. ID: "..id + S("You have been granted control over area #@1. Type /list_areas to show your areas.", id)) + return true, S("Area protected. ID: ")..id end }) minetest.register_chatcommand("rename_area", { params = " ", - description = "Rename a area that you own", + description = S("Rename a area that you own"), func = function(name, param) local id, newName = param:match("^(%d+)%s(.+)$") if not id then - return false, "Invalid usage, see /help rename_area." + return false, S("Invalid usage, see /help rename_area.") end id = tonumber(id) if not id then - return false, "That area doesn't exist." + return false, S("That area doesn't exist.") end if not areas:isAreaOwner(id, name) then - return true, "You don't own that area." + return true, S("You don't own that area.") end areas.areas[id].name = newName areas:save() - return true, "Area renamed." + return true, S("Area renamed.") end }) minetest.register_chatcommand("find_areas", { params = "", - description = "Find areas using a Lua regular expression", + description = S("Find areas using a Lua regular expression"),, privs = areas.adminPrivs, func = function(name, param) if param == "" then - return false, "A regular expression is required." + return false, S("A regular expression is required.") end -- Check expression for validity @@ -154,7 +152,7 @@ minetest.register_chatcommand("find_areas", { ("Test [1]: Player (0,0,0) (0,0,0)"):find(param) end if not pcall(testRegExp) then - return false, "Invalid regular expression." + return false, S("Invalid regular expression.") end local matches = {} @@ -167,14 +165,14 @@ minetest.register_chatcommand("find_areas", { if #matches > 0 then return true, table.concat(matches, "\n") else - return true, "No matches found." + return true, S("No matches found.") end end }) minetest.register_chatcommand("list_areas", { - description = "List your areas, or all areas if you are an admin.", + description = S("List your areas, or all areas if you are an admin."), func = function(name, param) local admin = minetest.check_player_privs(name, areas.adminPrivs) local areaStrings = {} @@ -184,7 +182,7 @@ minetest.register_chatcommand("list_areas", { end end if #areaStrings == 0 then - return true, "No visible areas." + return true, S("No visible areas.") end return true, table.concat(areaStrings, "\n") end @@ -193,149 +191,151 @@ minetest.register_chatcommand("list_areas", { minetest.register_chatcommand("recursive_remove_areas", { params = "", - description = "Recursively remove areas using an id", + description = S("Recursively remove areas using an id"), func = function(name, param) local id = tonumber(param) if not id then - return false, "Invalid usage, see" - .." /help recursive_remove_areas" + return false, S("Invalid usage, see" + .." /help recursive_remove_areas") end if not areas:isAreaOwner(id, name) then - return false, "Area "..id.." does not exist or is" - .." not owned by you." + return false, S("Area @1 does not exist or is" + .." not owned by you.", id) end areas:remove(id, true) areas:save() - return true, "Removed area "..id.." and it's sub areas." + return true, S("Removed area @1 and it's sub areas.", id) end }) minetest.register_chatcommand("remove_area", { params = "", - description = "Remove an area using an id", + description = S("Remove an area using an id"), func = function(name, param) local id = tonumber(param) if not id then - return false, "Invalid usage, see /help remove_area" + return false, S("Invalid usage, see /help remove_area") end if not areas:isAreaOwner(id, name) then - return false, "Area "..id.." does not exist or" - .." is not owned by you." + return false, S("Area @1 does not exist or" + .." is not owned by you.", id) end areas:remove(id) areas:save() - return true, "Removed area "..id + return true, S("Removed area @1", id) end }) minetest.register_chatcommand("change_owner", { params = " ", - description = "Change the owner of an area using it's ID", + description = S("Change the owner of an area using it's ID"), func = function(name, param) local id, newOwner = param:match("^(%d+)%s(%S+)$") if not id then - return false, "Invalid usage, see" - .." /help change_owner." + return false, S("Invalid usage, see" + .." /help change_owner.") end if not areas:player_exists(newOwner) then - return false, "The player \""..newOwner - .."\" does not exist." + return false, S("The player \"@1\" does not exist.", newOwner) end id = tonumber(id) if not areas:isAreaOwner(id, name) then - return false, "Area "..id.." does not exist" - .." or is not owned by you." + return false, S("Area @1 does not exist" + .." or is not owned by you.", id) end areas.areas[id].owner = newOwner areas:save() minetest.chat_send_player(newOwner, - ("%s has given you control over the area %q (ID %d).") - :format(name, areas.areas[id].name, id)) - return true, "Owner changed." + S("@1 has given you control over the area @2 (ID @3).",name, areas.areas[id].name, id)) + return true, S("Owner changed.") end }) minetest.register_chatcommand("area_open", { params = "", - description = "Toggle an area open (anyone can interact) or closed", + description = S("Toggle an area open (anyone can interact) or closed"), func = function(name, param) local id = tonumber(param) if not id then - return false, "Invalid usage, see /help area_open." + return false, S("Invalid usage, see /help area_open.") end if not areas:isAreaOwner(id, name) then - return false, "Area "..id.." does not exist" - .." or is not owned by you." + return false, S("Area @1 does not exist" + .." or is not owned by you.", id) end local open = not areas.areas[id].open + local open_msg = open and S("opened") or S("closed") -- Save false as nil to avoid inflating the DB. areas.areas[id].open = open or nil areas:save() - return true, ("Area %s."):format(open and "opened" or "closed") + -- Translators: @1 is one of the previous 'opened' or 'closed' + return true, S("Area @1.", open_msg) end }) minetest.register_chatcommand("area_openfarming", { params = "", - description = "Toggle an area open (anyone can interact farming) or closed", + description = S("Toggle an area open (anyone can interact farming) or closed"), func = function(name, param) local id = tonumber(param) if not id then - return false, "Invalid usage, see /help area_openfarming." + return false, S("Invalid usage, see /help area_openfarming.") end if not areas:isAreaOwner(id, name) then - return false, "Area "..id.." does not exist" - .." or is not owned by you." + return false, S("Area @1 does not exist" + .." or is not owned by you.", id) end local openfarming = not areas.areas[id].openfarming + local openfarming_msg = openfarming and S("opened") or S("closed") -- Save false as nil to avoid inflating the DB. areas.areas[id].openfarming = openfarming or nil areas:save() - return true, ("Area %s to farming."):format(openfarming and "opened" or "closed") + -- Translators: @1 is one of the previous 'opened' or 'closed' ++ return true, S("Area @1 to farming.", openfarming_msg) end }) minetest.register_chatcommand("move_area", { params = "", - description = "Move (or resize) an area to the current positions.", + description = S("Move (or resize) an area to the current positions."), privs = areas.adminPrivs, func = function(name, param) local id = tonumber(param) if not id then - return false, "Invalid usage, see /help move_area." + return false, S("Invalid usage, see /help move_area.") end local area = areas.areas[id] if not area then - return false, "Area does not exist." + return false, S("Area does not exist.") end local pos1, pos2 = areas:getPos(name) if not pos1 then - return false, "You need to select an area first." + return false, S("You need to select an area first.") end areas:move(id, area, pos1, pos2) areas:save() - return true, "Area successfully moved." + return true, S("Area successfully moved.") end, }) minetest.register_chatcommand("area_info", { - description = "Get information about area configuration and usage.", + description = S("Get information about area configuration and usage."), func = function(name, param) local lines = {} local privs = minetest.get_player_privs(name) @@ -358,26 +358,25 @@ minetest.register_chatcommand("area_info", { size_limit_high or size_limit -- Privilege information - local self_prot_line = ("Self protection is %sabled"):format( - self_prot and "en" or "dis") + local self_prot_msg = self_prot and S("enabled") or S("disabled") + -- Translators: @1 is one of the previous 'enabled' or 'disabled' + local self_prot_line = S("Self protection is @1 ", self_prot_msg) if self_prot and prot_priv then + local has_prot_priv_msg = has_prot_priv and S("and you") or S("but you don't") + -- Translators: @1 is one of the previous 'and you' or 'but you don't' self_prot_line = self_prot_line.. - (" %s have the neccessary privilege (%q).") - :format( - has_prot_priv and "and you" or - "but you don't", - prot_priv) + S(" @1 have the neccessary privilege (@2).", has_prot_priv_msg, prot_priv) else self_prot_line = self_prot_line.."." end table.insert(lines, self_prot_line) if privs.areas then - table.insert(lines, "You are an area".. - " administrator (\"areas\" privilege).") + table.insert(lines, S("You are an area".. + " administrator (\"areas\" privilege).")) elseif has_high_limit then table.insert(lines, - "You have extended area protection".. - " limits (\"areas_high_limit\" privilege).") + S("You have extended area protection".. + " limits (\"areas_high_limit\" privilege).")) end -- Area count @@ -387,25 +386,24 @@ minetest.register_chatcommand("area_info", { area_num = area_num + 1 end end - local count_line = ("You have %d area%s"):format( - area_num, area_num == 1 and "" or "s") + -- Translators: need to use NS gettext to be more precise + local count_line = S("You have @1 area@2", area_num, area_num == 1 and "" or "s") if privs.areas then count_line = count_line.. - " and have no area protection limits." + S(" and have no area protection limits.") elseif can_prot then - count_line = count_line..(", out of a maximum of %d.") - :format(max_count) + count_line = count_line..S(", out of a maximum of @1.", max_count) end table.insert(lines, count_line) -- Area size limits local function size_info(str, size) - table.insert(lines, ("%s spanning up to %dx%dx%d.") + table.insert(lines, (S("%s spanning up to %dx%dx%d.")) :format(str, size.x, size.y, size.z)) end local function priv_limit_info(priv, max_count, max_size) - size_info(("Players with the %q privilege".. - " can protect up to %d areas"):format( + size_info((S("Players with the %q privilege" + .." can protect up to %d areas")):format( priv, max_count), max_size) end if self_prot then @@ -415,7 +413,7 @@ minetest.register_chatcommand("area_info", { priv_limit_info("areas_high_limit", limit_high, size_limit_high) elseif has_prot_priv then - size_info("You can protect areas", max_size) + size_info(S("You can protect areas"), max_size) end end @@ -427,56 +425,56 @@ minetest.register_chatcommand("area_info", { +minetest.register_chatcommand("area_addspawn", { params = "", privs = areas.adminPrivs, - description = "Define special spawn for area", + description = S("Define special spawn for area"), func = function(name, param) local id = param:match("^(%d+)") if not id then - return false, "Invalid usage, see /help area_addspawn." + return false, S("Invalid usage, see /help area_addspawn.") end id = tonumber(id) if not id then - return false, "Error, Param id must be int." + return false, S("Error, Param id must be int.") end local player = minetest.get_player_by_name(name) if not player then - return false, "Error, there is not player" + return false, S("Error, there is not such player") end local pos = player:getpos() if not pos then - return false, "Error, there is not pos." + return false, S("Error, there is not pos.") end if not areas.areas[id] then - return false, "Area ".. id .." does not exist." + return false, S("Area @1 does not exist.", id) end areas.areas[id].spawn = pos areas:save() - return true, "spawn of area ".. id .." defined." + return true, S("spawn of area @1 defined.", id) end }) minetest.register_chatcommand("area_delspawn", { params = "", privs = areas.adminPrivs, - description = "Delete special spawn of area", + description = S("Delete special spawn of area"), func = function(name, param) local id = param:match("^(%d+)") if not id then - return false, "Invalid usage, see /help area_delspawn." + return false, S("Invalid usage, see /help area_delspawn.") end id = tonumber(id) if not id then - return false, "Error, Param id must be int." + return false, S("Error, Param id must be int.") end if not areas.areas[id] then - return false, "Area ".. id .." does not exist." + return false, S("Area @1 does not exist.", id) end areas.areas[id].spawn = nil areas:save() - return true, "spawn of area ".. id .." deleted." + return true, S("spawn of area @1 deleted.", id) end }) diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..d9b8b81 --- /dev/null +++ b/depends.txt @@ -0,0 +1 @@ +intllib? \ No newline at end of file diff --git a/hud.lua b/hud.lua index b8b4850..95ab63e 100644 --- a/hud.lua +++ b/hud.lua @@ -1,4 +1,5 @@ -- This is inspired by the landrush mod by Bremaweb +local S = areas.intllib areas.hud = {} @@ -6,7 +7,7 @@ local function tick() for _, player in pairs(minetest.get_connected_players()) do local name = player:get_player_name() local pos = vector.round(player:getpos()) - local area_text = "No area(s)\n\n" + local area_text = S("No area(s)").."\n\n" local area_owner_name = "" local mod_owner = 0 local mod_open = 0 @@ -47,7 +48,8 @@ local function tick() if nb_areas > 1 then plural = "s" end - area_text = ("%s\nOwner: %s\n%u area" .. plural):format(area_name, area_owner_name, nb_areas) + -- Translators: need to use NS gettext to be more precise + area_text = (S("%s\nOwner: %s\n%u area") .. plural):format(area_name, area_owner_name, nb_areas) icon = ("areas_%u_%u_%u.png"):format(mod_owner, mod_open, mod_farming) end if not areas.hud[name] then diff --git a/init.lua b/init.lua index d1b7ebe..216e25e 100644 --- a/init.lua +++ b/init.lua @@ -4,6 +4,11 @@ areas = {} +-- Load support for intllib. +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") +areas.intllib = S + areas.adminPrivs = {areas=true} areas.startTime = os.clock() @@ -20,20 +25,20 @@ dofile(areas.modpath.."/hud.lua") areas:load() minetest.register_privilege("areas", { - description = "Can administer areas." + description = S("Can administer areas.") }) minetest.register_privilege("areas_high_limit", { - description = "Can can more, bigger areas." + description = S("Can can more, bigger areas.") }) if not minetest.registered_privileges[areas.config.self_protection_privilege] then minetest.register_privilege(areas.config.self_protection_privilege, { - description = "Can protect areas.", + description = S("Can protect areas."), }) end if minetest.settings:get_bool("log_mod") then local diffTime = os.clock() - areas.startTime - minetest.log("action", "areas loaded in "..diffTime.."s.") + minetest.log("action", S("[MOD]areas loaded in @1s.", diffTime)) end diff --git a/interact.lua b/interact.lua index 78a1f6f..079793b 100644 --- a/interact.lua +++ b/interact.lua @@ -1,5 +1,4 @@ -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") +local S = areas.intllib local old_is_protected = minetest.is_protected function minetest.is_protected(pos, name) @@ -14,8 +13,8 @@ minetest.register_on_protection_violation(function(pos, name) local playerpos = player:getpos() if not areas:canInteract(pos, name) then local owners = areas:getNodeOwners(pos) - --minetest.chat_send_player(name, ("%s is protected by %s."):format(minetest.pos_to_string(pos), table.concat(owners, ", "))) - minetest.chat_send_player(name,S("@1 is protected by @2",minetest.pos_to_string(pos),table.concat(owners, ", "))) + --minetest.chat_send_player(name, (S("%s is protected by %s.")):format(minetest.pos_to_string(pos), table.concat(owners, ", "))) + minetest.chat_send_player(name,(S("%s is protected by %s.")),minetest.pos_to_string(pos),table.concat(owners, ", "))) minetest.after(1,anti_lag,{player=player,playerpos=playerpos}) end end) diff --git a/internal.lua b/internal.lua index 664c558..69f2027 100644 --- a/internal.lua +++ b/internal.lua @@ -1,5 +1,7 @@ +local S = areas.intllib + -- Mega_builder privilege -minetest.register_privilege("megabuilder","Can protect an infinite amount of areas.") +minetest.register_privilege("megabuilder",S("Can protect an infinite amount of areas.")) function areas:player_exists(name) return minetest.get_auth_handler().get_auth(name) ~= nil @@ -21,7 +23,7 @@ end function areas:save() local datastr = minetest.serialize(self.areas) if not datastr then - minetest.log("error", "[areas] Failed to serialize area data!") + minetest.log("error", S("[areas] Failed to serialize area data!")) return end return safe_file_write(self.config.filename, datastr) @@ -48,8 +50,8 @@ end -- @return Whether the ID was valid. function areas:checkAreaStoreId(sid) if not sid then - minetest.log("error", "AreaStore failed to find an ID for an " - .."area! Falling back to iterative area checking.") + minetest.log("error", S("AreaStore failed to find an ID for an " + .."area! Falling back to iterative area checking.")) self.store = nil self.store_ids = nil end @@ -200,8 +202,8 @@ function areas:canPlayerAddArea(pos1, pos2, name) -- and if the area is too big. if not self.config.self_protection or not privs[areas.config.self_protection_privilege] then - return false, "Self protection is disabled or you do not have" - .." the necessary privilege." + return false, S("Self protection is disabled or you do not have" + .." the necessary privilege.") end -- MFF: megabuilders skip checks on size and number of areas. @@ -214,7 +216,7 @@ function areas:canPlayerAddArea(pos1, pos2, name) (pos2.x - pos1.x) > max_size.x or (pos2.y - pos1.y) > max_size.y or (pos2.z - pos1.z) > max_size.z then - return false, "Area is too big." + return false, S("Area is too big.") end -- Check number of areas the user has and make sure it not above the max @@ -228,8 +230,8 @@ function areas:canPlayerAddArea(pos1, pos2, name) self.config.self_protection_max_areas_high or self.config.self_protection_max_areas if count >= max_areas then - return false, "You have reached the maximum amount of" - .." areas that you are allowed to protect." + return false, S("You have reached the maximum amount of" + .." areas that you are allowed to protect.") end end end @@ -238,7 +240,7 @@ end local can, id = self:canMakeArea(pos1, pos2, name) --MFF crabman(25/02/2016) fix areas in areas if not can then local area = self.areas[id] - return false, ("The area intersects with %s [%u] (%s).") + return false, (S("The area intersects with %s [%u] (%s).")) :format(area.name, id, area.owner) end diff --git a/legacy.lua b/legacy.lua index 83b3d27..5e7c2f7 100644 --- a/legacy.lua +++ b/legacy.lua @@ -1,25 +1,27 @@ -- This file contains functions to convert from -- the old areas format and other compatability code. +local S = areas.intllib + minetest.register_chatcommand("legacy_load_areas", { params = "", - description = "Loads, converts, and saves the areas from" - .." a legacy save file.", + description = S("Loads, converts, and saves the areas from" + .." a legacy save file."), privs = {areas=true, server=true}, func = function(name, param) - minetest.chat_send_player(name, "Converting areas...") + minetest.chat_send_player(name, S("Converting areas...")) local version = tonumber(param) if version == 0 then err = areas:node_ownership_load() if err then - minetest.chat_send_player(name, "Error loading legacy file: "..err) + minetest.chat_send_player(name, S("Error loading legacy file: ")..err) return end else - minetest.chat_send_player(name, "Invalid version number. (0 allowed)") + minetest.chat_send_player(name, S("Invalid version number. (0 allowed)")) return end - minetest.chat_send_player(name, "Legacy file loaded.") + minetest.chat_send_player(name, S("Legacy file loaded.")) for k, area in pairs(areas.areas) do -- New position format @@ -34,15 +36,15 @@ minetest.register_chatcommand("legacy_load_areas", { areas:sortPos(area.pos1, area.pos2) -- Add name - area.name = "unnamed" + area.name = S("unnamed") -- Remove ID area.id = nil end - minetest.chat_send_player(name, "Table format updated.") + minetest.chat_send_player(name, S("Table format updated.")) areas:save() - minetest.chat_send_player(name, "Converted areas saved. Done.") + minetest.chat_send_player(name, S("Converted areas saved. Done.")) end }) @@ -129,7 +131,7 @@ if areas.config.legacy_table then {x=a.x2, y=a.y2, z=a.z2} a.x1, a.y1, a.z1, a.x2, a.y2, a.z2 = nil, nil, nil, nil, nil, nil - a.name = a.name or "unnamed" + a.name = a.name or S("unnamed") a.id = nil return rawset(areas.areas, key, a) end diff --git a/locale/fr.po b/locale/fr.po index 72aa30a..e8f1db6 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-01-29 11:28+0200\n" -"PO-Revision-Date: 2018-01-29 09:18+0200\n" -"Last-Translator: \n" +"POT-Creation-Date: 2017-08-02 14:48+0200\n" +"PO-Revision-Date: 2017-08-02 15:35+0200\n" +"Last-Translator: fat115 \n" "Language-Team: \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -18,6 +18,503 @@ msgstr "" "X-Generator: Poedit 1.8.12\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +#: chatcommands.lua +msgid "Protect your own area" +msgstr "Protéger votre zone" + +#: chatcommands.lua +msgid "Invalid usage, see /help protect." +msgstr "Usage incorrect, consultez /help protect" + +#: chatcommands.lua +msgid "You need to select an area first." +msgstr "Vous devez d'abord sélectionner une zone." + +#: chatcommands.lua +msgid "/protect invoked, Owner =" +msgstr "/protect invoqué, Propriétaire =" + +#: chatcommands.lua +msgid "You can't protect that area: " +msgstr "Vous ne pouvez pas protéger cette zone : " + +#: chatcommands.lua +msgid "Area protected. ID: " +msgstr "La zone est désormais protégée. Elle porte le N°" + +#: chatcommands.lua +msgid "" +"Protect an area beetween two positions and give a player access to it " +"without setting the parent of the area to any existing area" +msgstr "" +"Protéger la zone entre deux positions et en donner l'accès à un joueur sans " +"définir de parent pour cette zone." + +#: chatcommands.lua +msgid "Incorrect usage, see /help set_owner." +msgstr "Usage incorrect, consultez /help set_owner" + +#: chatcommands.lua +msgid "The player \"@1\" does not exist." +msgstr "Le joueur \"@1\" n'existe pas." + +#: chatcommands.lua +msgid " runs /set_owner. Owner = " +msgstr " a lancé /set_owner. Propriétaire = " + +#: chatcommands.lua +msgid "" +"You have been granted control over area #@1. Type /list_areas to show your " +"areas." +msgstr "" +"Vous avez le contrôle sur la zone N°@1. Tapez /list pour voir la liste de " +"vos zones." + +#: chatcommands.lua +msgid "" +"Give a player access to a sub-area beetween two positions that have already " +"been protected, Use set_owner if you don't want the parent to be set." +msgstr "" +"Donne l'accès à un joueur pour la zone comprise entre deux positions déja " +"protégée. Utilisez plutot set_owner si vous ne souhaitez pas définir le " +"parent." + +#: chatcommands.lua +msgid "Incorrect usage, see /help add_owner" +msgstr "Usage incorrect, consultez /help add_owner" + +#: chatcommands.lua +msgid " runs /add_owner. Owner = " +msgstr " a lancé /add_owner. Propriétaire = " + +#: chatcommands.lua +msgid "You can't protect that area." +msgstr "Vous ne pouvez pas protéger cette zone." + +#: chatcommands.lua +msgid "Rename a area that you own" +msgstr "Renommer une zone que vous possédez" + +#: chatcommands.lua +msgid "Invalid usage, see /help rename_area." +msgstr "Usage incorrect, consultez /help rename_area." + +#: chatcommands.lua +msgid "That area doesn't exist." +msgstr "Cette zone n'existe pas." + +#: chatcommands.lua +msgid "You don't own that area." +msgstr "Vous ne possédez pas cette zone." + +#: chatcommands.lua +msgid "Area renamed." +msgstr "Zone renommée." + +#: chatcommands.lua +msgid "Find areas using a Lua regular expression" +msgstr "Rechercher des zones en utilisant une expression régulière Lua" + +#: chatcommands.lua +msgid "A regular expression is required." +msgstr "Une expression régulière est requise." + +#: chatcommands.lua +msgid "Invalid regular expression." +msgstr "Expression régulière invalide." + +#: chatcommands.lua +msgid "No matches found." +msgstr "Aucun résultat." + +#: chatcommands.lua +msgid "List your areas, or all areas if you are an admin." +msgstr "Affiche vos zones (ou toutes les zones si vous êtes administrateur)." + +#: chatcommands.lua +msgid "No visible areas." +msgstr "Aucune zone visible." + +#: chatcommands.lua +msgid "Recursively remove areas using an id" +msgstr "Supprimer récursivement des zones en utilisant un numéro" + +#: chatcommands.lua +msgid "Invalid usage, see /help recursive_remove_areas" +msgstr "Usage incorrect, consultez /help recursive_remove_areas" + +#: chatcommands.lua +msgid "Area @1 does not exist or is not owned by you." +msgstr "La zone @1 n'existe pas ou ne vous appartient pas." + +#: chatcommands.lua +msgid "Removed area @1 and it's sub areas." +msgstr "Zone @1 supprimée ainsi que toutes ses sous-zones." + +#: chatcommands.lua +msgid "Remove an area using an id" +msgstr "Supprimer une zone en utilisant son numéro" + +#: chatcommands.lua +msgid "Invalid usage, see /help remove_area" +msgstr "Usage incorrect, consultez /help remove_area" + +#: chatcommands.lua +msgid "Removed area @1" +msgstr "Zone @1 supprimée" + +#: chatcommands.lua +msgid "Change the owner of an area using it's ID" +msgstr "Modifier le propriétaire d'une zone en utilisant son numéro" + +#: chatcommands.lua +msgid "Invalid usage, see /help change_owner." +msgstr "Usage incorrect, consultez /help change_owner." + +#: chatcommands.lua +msgid "@1 has given you control over the area @2 (ID @3)." +msgstr "@1 vous a donné le contrôle sur la zone @2 (N° @3)." + +#: chatcommands.lua +msgid "Owner changed." +msgstr "Propriétaire modifié." + +#: chatcommands.lua +msgid "Toggle an area open (anyone can interact) or closed" +msgstr "" +"Bascule une zone en mode ouvert (n’importe qui peut interagir) ou fermé" + +#: chatcommands.lua +msgid "Invalid usage, see /help area_open." +msgstr "Usage incorrect, consultez /help area_open." + +#: chatcommands.lua +msgid "closed" +msgstr "fermée" + +#: chatcommands.lua +msgid "opened" +msgstr "ouverte" + +#. Translators: @1 is one of the previous 'opened' or 'closed' +#: chatcommands.lua +msgid "Area @1." +msgstr "Zone @1." + +#: chatcommands.lua +msgid "Toggle an area open (anyone can interact farming) or closed" +msgstr "" +"Bascule une zone en mode culture ouverte (n’importe qui peut cultiver) ou " +"fermée" + +#: chatcommands.lua +msgid "Invalid usage, see /help area_openfarming." +msgstr "Usage incorrect, consultez /help area_openfarming." + +#. Translators: @1 is one of the previous 'opened' or 'closed' +#: chatcommands.lua +msgid "Area @1 to farming." +msgstr "Zone @1 à la culture." + +#: chatcommands.lua +msgid "Move (or resize) an area to the current positions." +msgstr "Déplace (ou redimensionne) une zone avec les positions actuelles." + +#: chatcommands.lua +msgid "Invalid usage, see /help move_area." +msgstr "Usage incorrect, consultez /help move_area" + +#: chatcommands.lua +msgid "Area does not exist." +msgstr "La zone n'existe pas." + +#: chatcommands.lua +msgid "Area successfully moved." +msgstr "La zone a été déplacée." + +#: chatcommands.lua +msgid "Get information about area configuration and usage." +msgstr "Affiche les informations sur la configuration des zones et leur usage." + +#: chatcommands.lua +msgid "disabled" +msgstr "désactivée" + +#: chatcommands.lua +msgid "enabled" +msgstr "activée" + +#. Translators: @1 is one of the previous 'enabled' or 'disabled' +#: chatcommands.lua +msgid "Self protection is @1 " +msgstr "L'auto-protection est @1 " + +#: chatcommands.lua +msgid "and you" +msgstr "et vous avez" + +#: chatcommands.lua +msgid "but you don't" +msgstr "mais vous n'avez pas" + +#. Translators: @1 is one of the previous 'and you' or 'but you don't' +#: chatcommands.lua +msgid " @1 have the neccessary privilege (@2)." +msgstr " @1 le privilège requis (@2)." + +#: chatcommands.lua +msgid "You are an area administrator (\"areas\" privilege)." +msgstr "Vous êtes administrateur de zones (privilège \\\"areas\\\" )." + +#: chatcommands.lua +msgid "" +"You have extended area protection limits (\"areas_high_limit\" privilege)." +msgstr "" +"Vous pouvez protéger de grandes zones (privilège \\\"areas_high_limit\\\")." + +#. Translators: need to use NS gettext to be more precise +#: chatcommands.lua +msgid "You have @1 area@2" +msgstr "Vous êtes propriétaire de @1 zone@2" + +#: chatcommands.lua +msgid " and have no area protection limits." +msgstr " et n'avez pas de limite de protection de zones." + +#: chatcommands.lua +msgid ", out of a maximum of @1." +msgstr ", sur un maximum de @1." + +#: chatcommands.lua +#, lua-format +msgid "%s spanning up to %dx%dx%d." +msgstr "%s étendue jusqu’à %dx%dx%d." + +#: chatcommands.lua +#, lua-format +msgid "Players with the %q privilege can protect up to %d areas" +msgstr "Les joueurs avec le privilège %q peuvent protéger jusqu'à %d zones" + +#: chatcommands.lua +msgid "You can protect areas" +msgstr "Vous pouvez protéger des zones" + +#: chatcommands.lua +msgid "Define special spawn for area" +msgstr "Définit un spawn spécifique à une zone" + +#: chatcommands.lua +msgid "Invalid usage, see /help area_addspawn." +msgstr "Usage incorrect, consultez /help area_addspawn." + +#: chatcommands.lua +msgid "Error, Param id must be int." +msgstr "Erreur, le paramètre id doit être un entier" + +#: chatcommands.lua +msgid "Error, there is not such player" +msgstr "Erreur, pas de joueur à ce nom" + +#: chatcommands.lua +msgid "Error, there is not pos." +msgstr "Erreur, position invalide." + +#: chatcommands.lua +msgid "Area @1 does not exist." +msgstr "La zone @1 n'existe pas." + +#: chatcommands.lua +msgid "spawn of area @1 defined." +msgstr "spawn de la zone @1 défini." + +#: chatcommands.lua +msgid "Delete special spawn of area" +msgstr "Supprime le spawn spécifique à une zone" + +#: chatcommands.lua +msgid "Invalid usage, see /help area_delspawn." +msgstr "Usage incorrect, consultez /help area_delspawn." + +#: chatcommands.lua +msgid "spawn of area @1 deleted." +msgstr "spawn de la zone @1 supprimé." + +#: hud.lua +msgid "No area(s)" +msgstr "Pas de zone" + +#. Translators: need to use NS gettext to be more precise +#: hud.lua +#, lua-format +msgid "" +"%s\n" +"Owner: %s\n" +"%u area" +msgstr "" +"%s\n" +"Propriétaire : %s\n" +"%u zone" + #: init.lua -msgid "@1 is protected by @2" -msgstr "@1 est protégé par @2" +msgid "Can administer areas." +msgstr "Droit d’administrer des zones" + +#: init.lua +msgid "Can can more, bigger areas." +msgstr "Droit de créer des zones plus grandes." + +#: init.lua +msgid "Can protect areas." +msgstr "Droit de protéger des zones." + +#: init.lua +msgid "[MOD]areas loaded in @1s." +msgstr "[MOD]areas chargé en @1s." + +#: interact.lua +#, lua-format +msgid "%s is protected by %s." +msgstr "%s est protégée par %s" + +#: internal.lua +msgid "Self protection is disabled or you do not have the necessary privilege." +msgstr "" +"L'auto-protection est désactivée ou vous n'avez pas les privilèges requis." + +#: internal.lua +msgid "Area is too big." +msgstr "La zone est trop grande." + +#: internal.lua +msgid "" +"You have reached the maximum amount of areas that you are allowed to protect." +msgstr "" +"Vous avez atteint le nombre maximum de zones que vous êtes autorisé a " +"protéger." + +#: internal.lua +#, lua-format +msgid "The area intersects with %s [%u] (%s)." +msgstr "Cette zone se recoupe avec %s [%u] (%s)." + +#: legacy.lua +msgid "Loads, converts, and saves the areas from a legacy save file." +msgstr "Charge, convertit et sauvegarde les zones depuis un ancien fichier" + +#: legacy.lua +msgid "Converting areas..." +msgstr "Conversion des zones..." + +#: legacy.lua +msgid "Error loading legacy file: " +msgstr "Erreur de chargement du fichier : " + +#: legacy.lua +msgid "Invalid version number. (0 allowed)" +msgstr "Numéro de version incorrect. (0 autorisé)" + +#: legacy.lua +msgid "Legacy file loaded." +msgstr "Ancien fichier chargé." + +#: legacy.lua +msgid "unnamed" +msgstr "sans nom" + +#: legacy.lua +msgid "Table format updated." +msgstr "Format de table mis à jour." + +#: legacy.lua +msgid "Converted areas saved. Done." +msgstr "Zones converties sauvegardées. Terminé." + +#: pos.lua +msgid "Select a area by id." +msgstr "Sélectionnez une zone par son numéro" + +#: pos.lua +msgid "Invalid usage, see /help select_area." +msgstr "Usage incorrect, consultez /help select_area." + +#: pos.lua +msgid "The area @1 does not exist." +msgstr "La zone @1 n'existe pas." + +#: pos.lua +msgid "Area @1 selected." +msgstr "La zone @1 est sélectionnée." + +#: pos.lua +msgid "" +"Set area protection region position 1 to your location or the one specified" +msgstr "" +"Définit la position 1 de la zone à protéger à votre position ou à celle " +"spécifiée" + +#: pos.lua +msgid "Unable to get position." +msgstr "Impossible d'utiliser cette position." + +#: pos.lua +msgid "Invalid usage, see /help area_pos1." +msgstr "Usage incorect, consultez /help area_pos1." + +#: pos.lua +msgid "Area position 1 set to " +msgstr "Position 1 de la zone définie en " + +#: pos.lua +msgid "" +"Set area protection region position 2 to your location or the one specified" +msgstr "" +"Définit la position 2 de la zone à protéger à votre position ou à celle " +"spécifiée" + +#: pos.lua +msgid "Invalid usage, see /help area_pos2." +msgstr "Usage incorrect, consultez /help area_pos2." + +#: pos.lua +msgid "Area position 2 set to " +msgstr "Position 2 de la zone définie en " + +#: pos.lua +msgid "" +"Set area protection region, position 1, or position 2 by punching nodes, or " +"display the region" +msgstr "" +"Définit la région de votre zone protégée, position 1 ou position 2 en tapant " +"sur un bloc ou, affiche la région" + +#: pos.lua +msgid "Select positions by punching two nodes." +msgstr "Tapez sur deux blocs pour sélectionner les positions." + +#: pos.lua +msgid "Select position 1 by punching a node." +msgstr "Choisissez la position 1 en tapant sur un bloc." + +#: pos.lua +msgid "Select position 2 by punching a node." +msgstr "Choisissez la position 2 en tapant sur un bloc." + +#: pos.lua +msgid "" +msgstr "" + +#: pos.lua +msgid "Unknown subcommand: " +msgstr "Sous-commande inconnue : " + +#: pos.lua +msgid "Position 1 set to " +msgstr "Position 1 définie en " + +#: pos.lua +msgid "Position 2 set to " +msgstr "Position 2 définie en " + +#: settings.lua +msgid "Invalid setting type!" +msgstr "Type de réglage invalide !" diff --git a/locale/template.pot b/locale/template.pot new file mode 100644 index 0000000..d0e6f98 --- /dev/null +++ b/locale/template.pot @@ -0,0 +1,496 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-02 14:48+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: chatcommands.lua +msgid "Protect your own area" +msgstr "" + +#: chatcommands.lua +msgid "Invalid usage, see /help protect." +msgstr "" + +#: chatcommands.lua +msgid "You need to select an area first." +msgstr "" + +#: chatcommands.lua +msgid "/protect invoked, Owner =" +msgstr "" + +#: chatcommands.lua +msgid "You can't protect that area: " +msgstr "" + +#: chatcommands.lua +msgid "Area protected. ID: " +msgstr "" + +#: chatcommands.lua +msgid "" +"Protect an area beetween two positions and give a player access to it " +"without setting the parent of the area to any existing area" +msgstr "" + +#: chatcommands.lua +msgid "Incorrect usage, see /help set_owner." +msgstr "" + +#: chatcommands.lua +msgid "The player \"@1\" does not exist." +msgstr "" + +#: chatcommands.lua +msgid " runs /set_owner. Owner = " +msgstr "" + +#: chatcommands.lua +msgid "" +"You have been granted control over area #@1. Type /list_areas to show your " +"areas." +msgstr "" + +#: chatcommands.lua +msgid "" +"Give a player access to a sub-area beetween two positions that have already " +"been protected, Use set_owner if you don't want the parent to be set." +msgstr "" + +#: chatcommands.lua +msgid "Incorrect usage, see /help add_owner" +msgstr "" + +#: chatcommands.lua +msgid " runs /add_owner. Owner = " +msgstr "" + +#: chatcommands.lua +msgid "You can't protect that area." +msgstr "" + +#: chatcommands.lua +msgid "Rename a area that you own" +msgstr "" + +#: chatcommands.lua +msgid "Invalid usage, see /help rename_area." +msgstr "" + +#: chatcommands.lua +msgid "That area doesn't exist." +msgstr "" + +#: chatcommands.lua +msgid "You don't own that area." +msgstr "" + +#: chatcommands.lua +msgid "Area renamed." +msgstr "" + +#: chatcommands.lua +msgid "Find areas using a Lua regular expression" +msgstr "" + +#: chatcommands.lua +msgid "A regular expression is required." +msgstr "" + +#: chatcommands.lua +msgid "Invalid regular expression." +msgstr "" + +#: chatcommands.lua +msgid "No matches found." +msgstr "" + +#: chatcommands.lua +msgid "List your areas, or all areas if you are an admin." +msgstr "" + +#: chatcommands.lua +msgid "No visible areas." +msgstr "" + +#: chatcommands.lua +msgid "Recursively remove areas using an id" +msgstr "" + +#: chatcommands.lua +msgid "Invalid usage, see /help recursive_remove_areas" +msgstr "" + +#: chatcommands.lua +msgid "Area @1 does not exist or is not owned by you." +msgstr "" + +#: chatcommands.lua +msgid "Removed area @1 and it's sub areas." +msgstr "" + +#: chatcommands.lua +msgid "Remove an area using an id" +msgstr "" + +#: chatcommands.lua +msgid "Invalid usage, see /help remove_area" +msgstr "" + +#: chatcommands.lua +msgid "Removed area @1" +msgstr "" + +#: chatcommands.lua +msgid "Change the owner of an area using it's ID" +msgstr "" + +#: chatcommands.lua +msgid "Invalid usage, see /help change_owner." +msgstr "" + +#: chatcommands.lua +msgid "@1 has given you control over the area @2 (ID @3)." +msgstr "" + +#: chatcommands.lua +msgid "Owner changed." +msgstr "" + +#: chatcommands.lua +msgid "Toggle an area open (anyone can interact) or closed" +msgstr "" + +#: chatcommands.lua +msgid "Invalid usage, see /help area_open." +msgstr "" + +#: chatcommands.lua +msgid "closed" +msgstr "" + +#: chatcommands.lua +msgid "opened" +msgstr "" + +#. Translators: @1 is one of the previous 'opened' or 'closed' +#: chatcommands.lua +msgid "Area @1." +msgstr "" + +#: chatcommands.lua +msgid "Toggle an area open (anyone can interact farming) or closed" +msgstr "" + +#: chatcommands.lua +msgid "Invalid usage, see /help area_openfarming." +msgstr "" + +#. Translators: @1 is one of the previous 'opened' or 'closed' +#: chatcommands.lua +msgid "Area @1 to farming." +msgstr "" + +#: chatcommands.lua +msgid "Move (or resize) an area to the current positions." +msgstr "" + +#: chatcommands.lua +msgid "Invalid usage, see /help move_area." +msgstr "" + +#: chatcommands.lua +msgid "Area does not exist." +msgstr "" + +#: chatcommands.lua +msgid "Area successfully moved." +msgstr "" + +#: chatcommands.lua +msgid "Get information about area configuration and usage." +msgstr "" + +#: chatcommands.lua +msgid "disabled" +msgstr "" + +#: chatcommands.lua +msgid "enabled" +msgstr "" + +#. Translators: @1 is one of the previous 'enabled' or 'disabled' +#: chatcommands.lua +msgid "Self protection is @1 " +msgstr "" + +#: chatcommands.lua +msgid "and you" +msgstr "" + +#: chatcommands.lua +msgid "but you don't" +msgstr "" + +#. Translators: @1 is one of the previous 'and you' or 'but you don't' +#: chatcommands.lua +msgid " @1 have the neccessary privilege (@2)." +msgstr "" + +#: chatcommands.lua +msgid "You are an area administrator (\"areas\" privilege)." +msgstr "" + +#: chatcommands.lua +msgid "" +"You have extended area protection limits (\"areas_high_limit\" privilege)." +msgstr "" + +#. Translators: need to use NS gettext to be more precise +#: chatcommands.lua +msgid "You have @1 area@2" +msgstr "" + +#: chatcommands.lua +msgid " and have no area protection limits." +msgstr "" + +#: chatcommands.lua +msgid ", out of a maximum of @1." +msgstr "" + +#: chatcommands.lua +#, lua-format +msgid "%s spanning up to %dx%dx%d." +msgstr "" + +#: chatcommands.lua +#, lua-format +msgid "Players with the %q privilege can protect up to %d areas" +msgstr "" + +#: chatcommands.lua +msgid "You can protect areas" +msgstr "" + +#: chatcommands.lua +msgid "Define special spawn for area" +msgstr "" + +#: chatcommands.lua +msgid "Invalid usage, see /help area_addspawn." +msgstr "" + +#: chatcommands.lua +msgid "Error, Param id must be int." +msgstr "" + +#: chatcommands.lua +msgid "Error, there is not such player" +msgstr "" + +#: chatcommands.lua +msgid "Error, there is not pos." +msgstr "" + +#: chatcommands.lua +msgid "Area @1 does not exist." +msgstr "" + +#: chatcommands.lua +msgid "spawn of area @1 defined." +msgstr "" + +#: chatcommands.lua +msgid "Delete special spawn of area" +msgstr "" + +#: chatcommands.lua +msgid "Invalid usage, see /help area_delspawn." +msgstr "" + +#: chatcommands.lua +msgid "spawn of area @1 deleted." +msgstr "" + +#: hud.lua +msgid "No area(s)" +msgstr "" + +#. Translators: need to use NS gettext to be more precise +#: hud.lua +#, lua-format +msgid "" +"%s\n" +"Owner: %s\n" +"%u area" +msgstr "" + +#: init.lua +msgid "Can administer areas." +msgstr "" + +#: init.lua +msgid "Can can more, bigger areas." +msgstr "" + +#: init.lua +msgid "Can protect areas." +msgstr "" + +#: init.lua +msgid "[MOD]areas loaded in @1s." +msgstr "" + +#: interact.lua +#, lua-format +msgid "%s is protected by %s." +msgstr "" + +#: internal.lua +msgid "Self protection is disabled or you do not have the necessary privilege." +msgstr "" + +#: internal.lua +msgid "Area is too big." +msgstr "" + +#: internal.lua +msgid "" +"You have reached the maximum amount of areas that you are allowed to protect." +msgstr "" + +#: internal.lua +#, lua-format +msgid "The area intersects with %s [%u] (%s)." +msgstr "" + +#: legacy.lua +msgid "Loads, converts, and saves the areas from a legacy save file." +msgstr "" + +#: legacy.lua +msgid "Converting areas..." +msgstr "" + +#: legacy.lua +msgid "Error loading legacy file: " +msgstr "" + +#: legacy.lua +msgid "Invalid version number. (0 allowed)" +msgstr "" + +#: legacy.lua +msgid "Legacy file loaded." +msgstr "" + +#: legacy.lua +msgid "unnamed" +msgstr "" + +#: legacy.lua +msgid "Table format updated." +msgstr "" + +#: legacy.lua +msgid "Converted areas saved. Done." +msgstr "" + +#: pos.lua +msgid "Select a area by id." +msgstr "" + +#: pos.lua +msgid "Invalid usage, see /help select_area." +msgstr "" + +#: pos.lua +msgid "The area @1 does not exist." +msgstr "" + +#: pos.lua +msgid "Area @1 selected." +msgstr "" + +#: pos.lua +msgid "" +"Set area protection region position 1 to your location or the one specified" +msgstr "" + +#: pos.lua +msgid "Unable to get position." +msgstr "" + +#: pos.lua +msgid "Invalid usage, see /help area_pos1." +msgstr "" + +#: pos.lua +msgid "Area position 1 set to " +msgstr "" + +#: pos.lua +msgid "" +"Set area protection region position 2 to your location or the one specified" +msgstr "" + +#: pos.lua +msgid "Invalid usage, see /help area_pos2." +msgstr "" + +#: pos.lua +msgid "Area position 2 set to " +msgstr "" + +#: pos.lua +msgid "" +"Set area protection region, position 1, or position 2 by punching nodes, or " +"display the region" +msgstr "" + +#: pos.lua +msgid "Select positions by punching two nodes." +msgstr "" + +#: pos.lua +msgid "Select position 1 by punching a node." +msgstr "" + +#: pos.lua +msgid "Select position 2 by punching a node." +msgstr "" + +#: pos.lua +msgid "" +msgstr "" + +#: pos.lua +msgid "Unknown subcommand: " +msgstr "" + +#: pos.lua +msgid "Position 1 set to " +msgstr "" + +#: pos.lua +msgid "Position 2 set to " +msgstr "" + +#: settings.lua +msgid "Invalid setting type!" +msgstr "" diff --git a/pos.lua b/pos.lua index 8d3e6fe..535a170 100644 --- a/pos.lua +++ b/pos.lua @@ -1,10 +1,11 @@ - -- I could depend on WorldEdit for this, but you need to have the 'worldedit' -- permission to use those commands and you don't have -- /area_pos{1,2} [X Y Z|X,Y,Z]. -- Since this is mostly copied from WorldEdit it is mostly -- licensed under the AGPL. (select_area is a exception) +local S = areas.intllib + areas.marker1 = {} areas.marker2 = {} areas.set_pos = {} @@ -13,26 +14,26 @@ areas.pos2 = {} minetest.register_chatcommand("select_area", { params = "", - description = "Select a area by id.", + description = S("Select a area by id."), func = function(name, param) local id = tonumber(param) if not id then - return false, "Invalid usage, see /help select_area." + return false, S("Invalid usage, see /help select_area.") end if not areas.areas[id] then - return false, "The area "..id.." does not exist." + return false, S("The area @1 does not exist.", id) end areas:setPos1(name, areas.areas[id].pos1) areas:setPos2(name, areas.areas[id].pos2) - return true, "Area "..id.." selected." + return true, S("Area @1 selected.", id) end, }) minetest.register_chatcommand("area_pos1", { params = "[X Y Z|X,Y,Z]", - description = "Set area protection region position 1 to your" - .." location or the one specified", + description = S("Set area protection region position 1 to your" + .." location or the one specified"), privs = {}, func = function(name, param) local pos = nil @@ -45,22 +46,22 @@ minetest.register_chatcommand("area_pos1", { if player then pos = player:getpos() else - return false, "Unable to get position." + return false, S("Unable to get position.") end else - return false, "Invalid usage, see /help area_pos1." + return false, S("Invalid usage, see /help area_pos1.") end pos = vector.round(pos) areas:setPos1(name, pos) - return true, "Area position 1 set to " + return true, S("Area position 1 set to ") ..minetest.pos_to_string(pos) end, }) minetest.register_chatcommand("area_pos2", { params = "[X Y Z|X,Y,Z]", - description = "Set area protection region position 2 to your" - .." location or the one specified", + description = S("Set area protection region position 2 to your" + .." location or the one specified"), func = function(name, param) local pos = nil local found, _, x, y, z = param:find( @@ -72,14 +73,14 @@ minetest.register_chatcommand("area_pos2", { if player then pos = player:getpos() else - return false, "Unable to get position." + return false, S("Unable to get position.") end else - return false, "Invalid usage, see /help area_pos2." + return false, S("Invalid usage, see /help area_pos2.") end pos = vector.round(pos) areas:setPos2(name, pos) - return true, "Area position 2 set to " + return true, S("Area position 2 set to ") ..minetest.pos_to_string(pos) end, }) @@ -87,33 +88,33 @@ minetest.register_chatcommand("area_pos2", { minetest.register_chatcommand("area_pos", { params = "set/set1/set2/get", - description = "Set area protection region, position 1, or position 2" - .." by punching nodes, or display the region", + description = S("Set area protection region, position 1, or position 2" + .." by punching nodes, or display the region"), func = function(name, param) if param == "set" then -- Set both area positions areas.set_pos[name] = "pos1" - return true, "Select positions by punching two nodes." + return true, S("Select positions by punching two nodes.") elseif param == "set1" then -- Set area position 1 areas.set_pos[name] = "pos1only" - return true, "Select position 1 by punching a node." + return true, S("Select position 1 by punching a node.") elseif param == "set2" then -- Set area position 2 areas.set_pos[name] = "pos2" - return true, "Select position 2 by punching a node." + return true, S("Select position 2 by punching a node.") elseif param == "get" then -- Display current area positions local pos1str, pos2str = "Position 1: ", "Position 2: " if areas.pos1[name] then pos1str = pos1str..minetest.pos_to_string(areas.pos1[name]) else - pos1str = pos1str.."" + pos1str = pos1str..S("") end if areas.pos2[name] then pos2str = pos2str..minetest.pos_to_string(areas.pos2[name]) else - pos2str = pos2str.."" + pos2str = pos2str..S("") end return true, pos1str.."\n"..pos2str else - return false, "Unknown subcommand: "..param + return false, S("Unknown subcommand: ")..param end end, }) @@ -149,21 +150,21 @@ minetest.register_on_punchnode(function(pos, node, puncher) areas.markPos1(name) areas.set_pos[name] = "pos2" minetest.chat_send_player(name, - "Position 1 set to " + S("Position 1 set to ") ..minetest.pos_to_string(pos)) elseif areas.set_pos[name] == "pos1only" then areas.pos1[name] = pos areas.markPos1(name) areas.set_pos[name] = nil minetest.chat_send_player(name, - "Position 1 set to " + S("Position 1 set to ") ..minetest.pos_to_string(pos)) elseif areas.set_pos[name] == "pos2" then areas.pos2[name] = pos areas.markPos2(name) areas.set_pos[name] = nil minetest.chat_send_player(name, - "Position 2 set to " + S("Position 2 set to ") ..minetest.pos_to_string(pos)) end end diff --git a/settings.lua b/settings.lua index 6a11e67..e13d9bc 100644 --- a/settings.lua +++ b/settings.lua @@ -1,4 +1,5 @@ local world_path = minetest.get_worldpath() +local S = areas.intllib areas.config = {} @@ -14,7 +15,7 @@ local function setting(tp, name, default) elseif tp == "number" then value = tonumber(minetest.settings:get(full_name)) else - error("Invalid setting type!") + error(S("Invalid setting type!")) end if value == nil then value = default From 1eb4c76265b07868a6925fd2047cf1d1a4deab9c Mon Sep 17 00:00:00 2001 From: "Muhammad Nur Hidayat Yasuyoshi (MNH48.com)" Date: Sat, 17 Feb 2018 02:19:48 +0800 Subject: [PATCH 30/30] Manual update due to conflict (part 3) This adds part of PR #4 and they came from inpos/areas repo, author for the changes is inpos. --- locale/ru.po | 395 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 395 insertions(+) create mode 100644 locale/ru.po diff --git a/locale/ru.po b/locale/ru.po new file mode 100644 index 0000000..c303f9d --- /dev/null +++ b/locale/ru.po @@ -0,0 +1,395 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-02 14:48+0200\n" +"PO-Revision-Date: 2017-08-15 10:31+0300\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.3\n" +"Last-Translator: inpos \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Language: ru\n" + +msgid "Protect your own area" +msgstr "Защитить свою область" + +msgid "Invalid usage, see /help protect." +msgstr "Неверное использование, см. /help protect." + +msgid "You need to select an area first." +msgstr "Сначала надо выбрать область." + +msgid "/protect invoked, Owner =" +msgstr "/protect вызван, Владелец =" + +msgid "You can't protect that area: " +msgstr "Вы не можете защитить эту область: " + +msgid "Area protected. ID: " +msgstr "Область защищена. ID: " + +msgid "" +"Protect an area beetween two positions and give a player access to it " +"without setting the parent of the area to any existing area" +msgstr "Защитите область между двумя позициями и дайте игроку доступ к ней, не " +"устанавливая родителя области в любую существующую область" + +msgid "Incorrect usage, see /help set_owner." +msgstr "Неверное использование, см. /help set_owner." + +msgid "The player \"@1\" does not exist." +msgstr "Игрок \"@1\" не существует." + +msgid " runs /set_owner. Owner = " +msgstr " выполняется /set_owner. Владелец = " + +msgid "" +"You have been granted control over area #@1. Type /list_areas to show your " +"areas." +msgstr "Вы дали доступ на управление областью #@1. Наберите /list_areas для вывода " +"списка своих областей." + +msgid "" +"Give a player access to a sub-area beetween two positions that have already " +"been protected, Use set_owner if you don't want the parent to be set." +msgstr "Предоставьте игроку доступ к подзоне между двумя уже защищенными позициями. " +"Используйте set_owner, чтобы не устанавливать из родительской области." + +msgid "Incorrect usage, see /help add_owner" +msgstr "Неверное использование, см. /help add_owner" + +msgid " runs /add_owner. Owner = " +msgstr " выполняется /add_owner. Владелец = " + +msgid "You can't protect that area." +msgstr "Вы не можете защитить эту область." + +msgid "Rename a area that you own" +msgstr "Переименовать вашу область" + +msgid "Invalid usage, see /help rename_area." +msgstr "Неверное использование, см. /help rename_area." + +msgid "That area doesn't exist." +msgstr "Такой области не существует." + +msgid "You don't own that area." +msgstr "Это не ваша область." + +msgid "Area renamed." +msgstr "Область переименована." + +msgid "Find areas using a Lua regular expression" +msgstr "Найти области с помощью регулярных выражений Lua" + +msgid "A regular expression is required." +msgstr "Требуется регулярное выражение." + +msgid "Invalid regular expression." +msgstr "Неверное регулярное выражение." + +msgid "No matches found." +msgstr "Совпадений не найдено." + +msgid "List your areas, or all areas if you are an admin." +msgstr "Вывести список ваших областей или всех областей, если вы администратор." + +msgid "No visible areas." +msgstr "Нет видимых областей." + +msgid "Recursively remove areas using an id" +msgstr "Рекурсивно удалить области используя id" + +msgid "Invalid usage, see /help recursive_remove_areas" +msgstr "Неверное использование, см. /help recursive_remove_areas" + +msgid "Area @1 does not exist or is not owned by you." +msgstr "Область @1 не существует или не принадлежит вам." + +msgid "Removed area @1 and it's sub areas." +msgstr "Удалена область @1 и её подзоны." + +msgid "Remove an area using an id" +msgstr "Удалить область используя id" + +msgid "Invalid usage, see /help remove_area" +msgstr "Неверное использование, см. /help remove_area" + +msgid "Removed area @1" +msgstr "Удалена область @1" + +msgid "Change the owner of an area using it's ID" +msgstr "Изменить владельца области используя её ID" + +msgid "Invalid usage, see /help change_owner." +msgstr "Неверное использование, см. /help change_owner." + +msgid "@1 has given you control over the area @2 (ID @3)." +msgstr "@1 дал передал вам управление над областью @2 (ID @3)" + +msgid "Owner changed." +msgstr "Владелец изменён." + +msgid "Toggle an area open (anyone can interact) or closed" +msgstr "Переключить область в режим открытой (любой может взаимодействовать) или " +"закрытой" + +msgid "Invalid usage, see /help area_open." +msgstr "Неверное использование, см. /help area_open." + +msgid "closed" +msgstr "закрыта" + +msgid "opened" +msgstr "открыта" + +#. Translators: @1 is one of the previous 'opened' or 'closed' +msgid "Area @1." +msgstr "Область @1." + +msgid "Toggle an area open (anyone can interact farming) or closed" +msgstr "Переключить область в режим открытой (любой может изменять местность) или " +"закрытой" + +msgid "Invalid usage, see /help area_openfarming." +msgstr "Неверное использование, см. /help area_openfarming." + +#. Translators: @1 is one of the previous 'opened' or 'closed' +msgid "Area @1 to farming." +msgstr "Область @1 для добычи." + +msgid "Move (or resize) an area to the current positions." +msgstr "Переместить (или изменить размер) область в текущую позицию." + +msgid "Invalid usage, see /help move_area." +msgstr "Неверное использование, см. /help move_area." + +msgid "Area does not exist." +msgstr "Область не существует." + +msgid "Area successfully moved." +msgstr "Область перемещена." + +msgid "Get information about area configuration and usage." +msgstr "Получить информацию о конфигурации и использовании области." + +msgid "disabled" +msgstr "отключено" + +msgid "enabled" +msgstr "включено" + +#. Translators: @1 is one of the previous 'enabled' or 'disabled' +msgid "Self protection is @1 " +msgstr "Самозащита @1 " + +msgid "and you" +msgstr "и вы" + +msgid "but you don't" +msgstr "но вы не" + +#. Translators: @1 is one of the previous 'and you' or 'but you don't' +msgid " @1 have the neccessary privilege (@2)." +msgstr " @1 имеет соответствующие права (@2)." + +msgid "You are an area administrator (\"areas\" privilege)." +msgstr "Вы администратор области (права \"areas\")." + +msgid "" +"You have extended area protection limits (\"areas_high_limit\" privilege)." +msgstr "У вас расширенный ограничения защиты области (права \"areas_high_limit\")." + +#. Translators: need to use NS gettext to be more precise +msgid "You have @1 area@2" +msgstr "У вас @1 область@2" + +msgid " and have no area protection limits." +msgstr " и нет ограничений защиты области." + +msgid ", out of a maximum of @1." +msgstr ", превышен @1." + +#, lua-format +msgid "%s spanning up to %dx%dx%d." +msgstr "%s охватывает до %dx%dx%d." + +#, lua-format +msgid "Players with the %q privilege can protect up to %d areas" +msgstr "Игроки с правами %q могут защитить до %d областей." + +msgid "You can protect areas" +msgstr "Вы можете защитить области" + +msgid "Define special spawn for area" +msgstr "Определить специальную точку порождения для области" + +msgid "Invalid usage, see /help area_addspawn." +msgstr "Неверное использование, см. /help area_addspawn." + +msgid "Error, Param id must be int." +msgstr "Ошибка, параметр id должен быть целым числом." + +msgid "Error, there is not such player" +msgstr "Ошибка, не такого игрока" + +msgid "Error, there is not pos." +msgstr "Ошибка, это не позиция." + +msgid "Area @1 does not exist." +msgstr "Область @1 не существует." + +msgid "spawn of area @1 defined." +msgstr "точка порождения области @1 определена." + +msgid "Delete special spawn of area" +msgstr "Удалить специальную точку порождения области" + +msgid "Invalid usage, see /help area_delspawn." +msgstr "Неверное использование, см. /help area_delspawn." + +msgid "spawn of area @1 deleted." +msgstr "точка порождения области @1 удалена." + +msgid "No area(s)" +msgstr "Нет области(ей)" + +#. Translators: need to use NS gettext to be more precise +#, lua-format +msgid "" +"%s\n" +"Owner: %s\n" +"%u area" +msgstr "%s\n" +"Владелец: %s\n" +"%u область" + +msgid "Can administer areas." +msgstr "Может администрировать область." + +msgid "Can can more, bigger areas." +msgstr "Может больше (количество и размер) областей." + +msgid "Can protect areas." +msgstr "Может защитить области." + +msgid "[MOD]areas loaded in @1s." +msgstr "[MOD]areas загружен в @1s." + +#, lua-format +msgid "%s is protected by %s." +msgstr "%s защищено %s." + +msgid "Self protection is disabled or you do not have the necessary privilege." +msgstr "Самозащита отключена или у вас нет соответствующих прав." + +msgid "Area is too big." +msgstr "Область слишком большая." + +msgid "" +"You have reached the maximum amount of areas that you are allowed to protect." +msgstr "Вы превысили допустимое количество областей, которые можете защитить." + +#, lua-format +msgid "The area intersects with %s [%u] (%s)." +msgstr "Область пересекается с %s [%u] (%s)." + +msgid "Loads, converts, and saves the areas from a legacy save file." +msgstr "Загружает, конвертирует и сохраняет области в файл сохранения наследия." + +msgid "Converting areas..." +msgstr "Конвертация областей..." + +msgid "Error loading legacy file: " +msgstr "Ошибка загрузки файла наследия: " + +msgid "Invalid version number. (0 allowed)" +msgstr "Неверный номер версии. (0 разрешён)" + +msgid "Legacy file loaded." +msgstr "Файл наследия загружен." + +msgid "unnamed" +msgstr "безымянное" + +msgid "Table format updated." +msgstr "Формат таблицы обновлён." + +msgid "Converted areas saved. Done." +msgstr "Сконвертированные области сохранены. Выполнено." + +msgid "Select a area by id." +msgstr "Выбрать область по id" + +msgid "Invalid usage, see /help select_area." +msgstr "Неверное использование, см. /help select_area." + +msgid "The area @1 does not exist." +msgstr "Область @1 не существует." + +msgid "Area @1 selected." +msgstr "Область @1 выбрана." + +msgid "" +"Set area protection region position 1 to your location or the one specified" +msgstr "Установить позицию 1 зоны защиты области в своё местоположение или в " +"указанное" + +msgid "Unable to get position." +msgstr "Невозможно получить позицию." + +msgid "Invalid usage, see /help area_pos1." +msgstr "Неверное использование, см. /help area_pos1." + +msgid "Area position 1 set to " +msgstr "Позиция 1 области установлена в " + +msgid "" +"Set area protection region position 2 to your location or the one specified" +msgstr "Установить позицию 2 зоны защиты области в своё местоположение или в " +"указанное" + +msgid "Invalid usage, see /help area_pos2." +msgstr "Неверное использование, см. /help area_pos2." + +msgid "Area position 2 set to " +msgstr "Позиция 2 области установлена в " + +msgid "" +"Set area protection region, position 1, or position 2 by punching nodes, or " +"display the region" +msgstr "Установить зону защиты области, позицию 1 или 2 ударяя узлы, или отобразить " +"зону" + +msgid "Select positions by punching two nodes." +msgstr "Выберите позиции ударив два узла." + +msgid "Select position 1 by punching a node." +msgstr "Выберите позицию 1 ударив узел." + +msgid "Select position 2 by punching a node." +msgstr "Выберите позицию 2 ударив узел." + +msgid "" +msgstr "<не установлено>" + +msgid "Unknown subcommand: " +msgstr "Неизвестная подкоманда: " + +msgid "Position 1 set to " +msgstr "Позиция 1 установлена в " + +msgid "Position 2 set to " +msgstr "Позиция 2 установлена в " + +msgid "Invalid setting type!" +msgstr "Неверный тип установки!" +