diff --git a/mods/_various/areas/api.lua b/mods/_various/areas/api.lua index 2c62d2f84..9b046068a 100644 --- a/mods/_various/areas/api.lua +++ b/mods/_various/areas/api.lua @@ -46,10 +46,10 @@ end -- Note that this fails and returns false when the specified area is fully -- owned by the player, but with multiple protection zones, none of which -- cover the entire checked area. --- @param name (optional) player name. If not specified checks for any intersecting areas. --- @param allow_open Whether open areas should be counted as is they didn't exist. +-- @param name (optional) Player name. If not specified checks for any intersecting areas. +-- @param allow_open Whether open areas should be counted as if they didn't exist. -- @return Boolean indicating whether the player can interact in that area. --- @return Un-owned intersecting area id, if found. +-- @return Un-owned intersecting area ID, if found. function areas:canInteractInArea(pos1, pos2, name, allow_open) if name and minetest.check_player_privs(name, self.adminPrivs) then return true diff --git a/mods/_various/areas/chatcommands.lua b/mods/_various/areas/chatcommands.lua index 6660c6723..af064c1d1 100644 --- a/mods/_various/areas/chatcommands.lua +++ b/mods/_various/areas/chatcommands.lua @@ -1,16 +1,16 @@ -local SL = lord.require_intllib() +local S = minetest.get_translator("areas") minetest.register_chatcommand("protect", { - params = "", - description = SL("Protect your own area"), + params = S(""), + description = S("Protect your own area"), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) if param == "" then - return false, SL("Invalid usage, see").." /help protect." + return false, S("Invalid usage, see /help @1.", "protect") end local pos1, pos2 = areas:getPos(name) if not (pos1 and pos2) then - return false, SL("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.. @@ -20,20 +20,20 @@ minetest.register_chatcommand("protect", { local canAdd, errMsg = areas:canPlayerAddArea(pos1, pos2, name) if not canAdd then - return false, SL("You can't protect that area")..": "..errMsg + return false, S("You can't protect that area: @1", errMsg) end local id = areas:add(name, param, pos1, pos2, nil) areas:save() - return true, SL("Area protected.").." ID: "..id + return true, S("Area protected. ID: @1", id) end }) minetest.register_chatcommand("set_owner", { - params = " ", - description = SL("Protect an area beetween two positions and give" + params = S("").." "..S(""), + description = S("Protect an area between two positions and give" .." a player access to it without setting the parent of the" .." area to any existing area"), privs = areas.adminPrivs, @@ -41,16 +41,16 @@ minetest.register_chatcommand("set_owner", { local ownerName, areaName = param:match('^(%S+)%s(.+)$') if not ownerName then - return false, SL("Incorrect usage, see").." /help set_owner." + return false, S("Invalid usage, see /help @1.", "set_owner") end local pos1, pos2 = areas:getPos(name) if not (pos1 and pos2) then - return false, SL("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, SL("The player").." \""..ownerName.."\" "..SL("does not exist.") + return false, S("The player \"@1\" does not exist.", ownerName) end minetest.log("action", name.." runs /set_owner. Owner = "..ownerName.. @@ -61,34 +61,35 @@ minetest.register_chatcommand("set_owner", { local id = areas:add(ownerName, areaName, pos1, pos2, nil) areas:save() - minetest.chat_send_player(ownerName, SL("You have been granted control over area #")..id..SL(". Type /list_areas to show your areas.")) - return true, SL("Area protected.").." ID: "..id + minetest.chat_send_player(ownerName, + S("You have been granted control over area #@1. ".. + "Type /list_areas to show your areas.", id)) + return true, S("Area protected. ID: @1", id) end }) minetest.register_chatcommand("add_owner", { - params = " ", - description = SL("Give a player access to a sub-area beetween two" + params = S("").." "..S("").." "..S(""), + description = S("Give a player access to a sub-area between two" .." positions that have already been protected," .." Use set_owner if you don't want the parent to be set."), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) - local pid, ownerName, areaName - = param:match('^(%d+) ([^ ]+) (.+)$') + local pid, ownerName, areaName = param:match('^(%d+) ([^ ]+) (.+)$') if not pid then - minetest.chat_send_player(name, SL("Incorrect usage, see").." /help add_owner") + minetest.chat_send_player(name, S("Invalid usage, see /help @1.", "add_owner")) return end local pos1, pos2 = areas:getPos(name) if not (pos1 and pos2) then - return false, SL("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, SL("The player").." \""..ownerName.."\" "..SL("does not exist.") + return false, S("The player \"@1\" does not exist.", ownerName) end minetest.log("action", name.." runs /add_owner. Owner = "..ownerName.. @@ -100,51 +101,53 @@ minetest.register_chatcommand("add_owner", { pid = tonumber(pid) if (not areas:isAreaOwner(pid, name)) or (not areas:isSubarea(pos1, pos2, pid)) then - return false, SL("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, SL("You have been granted control over area #")..id..SL(". Type /list_areas to show your areas.")) - return true, SL("Area protected.").." ID: "..id + minetest.chat_send_player(ownerName, + S("You have been granted control over area #@1. ".. + "Type /list_areas to show your areas.", id)) + return true, S("Area protected. ID: @1", id) end }) minetest.register_chatcommand("rename_area", { - params = " ", - description = SL("Rename a area that you own"), + params = S("").." "..S(""), + description = S("Rename an area that you own"), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) local id, newName = param:match("^(%d+)%s(.+)$") if not id then - return false, SL("Invalid usage, see").." /help rename_area." + return false, S("Invalid usage, see /help @1.", "rename_area") end id = tonumber(id) if not id then - return false, SL("That area doesn't exist.") + return false, S("That area doesn't exist.") end if not areas:isAreaOwner(id, name) then - return true, SL("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, SL("Area renamed.") + return true, S("Area renamed.") end }) minetest.register_chatcommand("find_areas", { params = "", + description = S("Find areas using a Lua regular expression"), privs = areas.adminPrivs, - description = SL("Find areas using a Lua regular expression"), func = function(name, param) if param == "" then - return false, SL("A regular expression is required.") + return false, S("A regular expression is required.") end -- Check expression for validity @@ -152,7 +155,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, SL("Invalid regular expression.") + return false, S("Invalid regular expression.") end local matches = {} @@ -165,14 +168,14 @@ minetest.register_chatcommand("find_areas", { if #matches > 0 then return true, table.concat(matches, "\n") else - return true, SL("No matches found.") + return true, S("No matches found.") end end }) minetest.register_chatcommand("list_areas", { - description = SL("List your areas, or all areas if you are an admin"), + description = S("List your areas, or all areas if you are an admin."), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) local admin = minetest.check_player_privs(name, areas.adminPrivs) @@ -183,7 +186,7 @@ minetest.register_chatcommand("list_areas", { end end if #areaStrings == 0 then - return true, SL("No visible areas.") + return true, S("No visible areas.") end return true, table.concat(areaStrings, "\n") end @@ -191,126 +194,134 @@ minetest.register_chatcommand("list_areas", { minetest.register_chatcommand("recursive_remove_areas", { - params = "", - description = SL("Recursively remove areas using an id"), + params = S(""), + description = S("Recursively remove areas using an ID"), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) local id = tonumber(param) if not id then - return false, SL("Invalid usage, see").." /help recursive_remove_areas" + return false, S("Invalid usage, see" + .." /help @1.", "recursive_remove_areas") end if not areas:isAreaOwner(id, name) then - return false, SL("Area").." "..id.." "..SL("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, SL("Removed area").." "..id.." "..SL("and it's sub areas.") + return true, S("Removed area @1 and its sub areas.", id) end }) minetest.register_chatcommand("remove_area", { - params = "", - description = SL("Remove an area using an id"), + params = S(""), + description = S("Remove an area using an ID"), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) local id = tonumber(param) if not id then - return false, SL("Invalid usage, see").." /help remove_area" + return false, S("Invalid usage, see /help @1.", "remove_area") end if not areas:isAreaOwner(id, name) then - return false, SL("Area").." "..id.." "..SL("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, SL("Removed area").." "..id + return true, S("Removed area @1", id) end }) minetest.register_chatcommand("change_owner", { - params = " ", - description = SL("Change the owner of an area using it's ID"), + params = S("").." "..S(""), + description = S("Change the owner of an area using its ID"), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) local id, newOwner = param:match("^(%d+)%s(%S+)$") if not id then - return false, SL("Invalid usage, see").." /help change_owner." + return false, S("Invalid usage, see" + .." /help @1.", "change_owner") end if not areas:player_exists(newOwner) then - return false, SL("The player").." \""..newOwner.."\" "..SL("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, SL("Area").." "..id.." "..SL("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 "..SL("has given you control over the area").." %q (ID %d).") - :format(name, areas.areas[id].name, id)) - return true, SL("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 = SL("Toggle an area open (anyone can interact) or closed"), + params = S(""), + description = S("Toggle an area open (anyone can interact) or closed"), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) local id = tonumber(param) if not id then - return false, SL("Invalid usage, see").." /help area_open." + return false, S("Invalid usage, see /help @1.", "area_open") end if not areas:isAreaOwner(id, name) then - return false, SL("Area").." "..id.." "..SL("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 -- Save false as nil to avoid inflating the DB. areas.areas[id].open = open or nil areas:save() - return true, (SL("Area").." %s."):format(open and SL("opened") or SL("closed")) + return true, open and S("Area opened.") or S("Area closed.") end }) minetest.register_chatcommand("move_area", { - params = "", - description = SL("Move (or resize) an area to the current positions."), + params = S(""), + 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, SL("Invalid usage, see").." /help move_area." + return false, S("Invalid usage, see /help @1.", "move_area") end local area = areas.areas[id] if not area then - return false, SL("That area doesn't exist.") + return false, S("Area does not exist.") end local pos1, pos2 = areas:getPos(name) if not pos1 then - return false, SL("You need to select an area first.") + return false, S("You need to select an area first.") end area.pos1 = pos1 area.pos2 = pos2 areas:save() - return true, SL("Area successfully moved.") + + return true, S("Area successfully moved.") end, }) + minetest.register_chatcommand("area_info", { - description = SL("Get information about area configuration and usage."), + description = S("Get information about area configuration and usage."), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) local lines = {} @@ -333,24 +344,22 @@ minetest.register_chatcommand("area_info", { local max_size = has_high_limit and size_limit_high or size_limit - -- Privilege information - local self_prot_line = SL(("Self protection is %sabled"):format( - self_prot and "en" or "dis")) - if self_prot and prot_priv then - self_prot_line = self_prot_line.. - (", %s "..SL("have the neccessary privilege").." (%q).") - :format( - has_prot_priv and SL("and you") or - SL("but you don't"), - prot_priv) - else - self_prot_line = self_prot_line.."." - end + -- Self protection information + local self_prot_line = self_prot and S("Self protection is enabled.") or + S("Self protection is disabled.") table.insert(lines, self_prot_line) + -- Privilege information + local priv_line = has_prot_priv and + S("You have the necessary privilege (\"@1\").", prot_priv) or + S("You don't have the necessary privilege (\"@1\").", prot_priv) + table.insert(lines, priv_line) if privs.areas then - table.insert(lines, SL("You are an area administrator").." (\"areas\" "..SL("privilege).")) + table.insert(lines, S("You are an area".. + " administrator (\"areas\" privilege).")) elseif has_high_limit then - table.insert(lines, SL("You have extended area protection limits").." (\"areas_high_limit\" "..SL("privilege).")) + table.insert(lines, + S("You have extended area protection".. + " limits (\"areas_high_limit\" privilege).")) end -- Area count @@ -360,28 +369,32 @@ minetest.register_chatcommand("area_info", { area_num = area_num + 1 end end - local count_line = SL("Number of your areas:").." "..tostring(area_num) - if privs.areas then - count_line = count_line.."; "..SL("you have no area protection limits.") - elseif can_prot then - count_line = count_line.."; "..SL("the maximum number").." - "..tostring(max_count).."." - end - table.insert(lines, count_line) + table.insert(lines, S("You have @1 areas.", area_num)) + + -- Area limit + local area_limit_line = privs.areas and + S("Limit: no area count limit") or + S("Limit: @1 areas", max_count) + table.insert(lines, area_limit_line) -- Area size limits local function size_info(str, size) - table.insert(lines, ("%s "..SL("spanning up to").." %dx%dx%d."):format(str, size.x, size.y, size.z)) + table.insert(lines, S("@1 spanning up to @2x@3x@4.", + str, size.x, size.y, size.z)) end - local function priv_limit_info(priv, max_count, max_size) - size_info((SL("Players with the").." %q "..SL("privilege").. - " "..SL("can protect up to").." %d "..SL("areas")):format(priv, max_count), max_size) + local function priv_limit_info(lpriv, lmax_count, lmax_size) + size_info(S("Players with the \"@1\" privilege".. + " can protect up to @2 areas", lpriv, lmax_count), + lmax_size) end if self_prot then if privs.areas then - priv_limit_info(prot_priv, limit, size_limit) - priv_limit_info("areas_high_limit", limit_high, size_limit_high) + priv_limit_info(prot_priv, + limit, size_limit) + priv_limit_info("areas_high_limit", + limit_high, size_limit_high) elseif has_prot_priv then - size_info(SL("You can protect areas"), max_size) + size_info(S("You can protect areas"), max_size) end end diff --git a/mods/_various/areas/hud.lua b/mods/_various/areas/hud.lua index e6b6b8289..f42cf284f 100644 --- a/mods/_various/areas/hud.lua +++ b/mods/_various/areas/hud.lua @@ -1,7 +1,5 @@ -local SL = lord.require_intllib() - -- This is inspired by the landrush mod by Bremaweb - +local S = minetest.get_translator("areas") areas.hud = {} minetest.register_globalstep(function(dtime) @@ -12,9 +10,9 @@ minetest.register_globalstep(function(dtime) 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 SL(":open") or "")) + area.open and S(":open") or "")) end - local areaString = SL("Areas:") + local areaString = S("Areas:") if #areaStrings > 0 then areaString = areaString.."\n".. table.concat(areaStrings, "\n") diff --git a/mods/_various/areas/init.lua b/mods/_various/areas/init.lua index 6d4851fae..e46ce47e8 100644 --- a/mods/_various/areas/init.lua +++ b/mods/_various/areas/init.lua @@ -1,5 +1,3 @@ -local SL = lord.require_intllib() - -- Areas mod by ShadowNinja -- Based on node_ownership -- License: LGPLv2+ @@ -21,15 +19,19 @@ dofile(areas.modpath.."/hud.lua") areas:load() +local S = minetest.get_translator("areas") + minetest.register_privilege("areas", { - description = SL("Can administer areas.") + description = S("Can administer areas."), + give_to_singleplayer = false }) minetest.register_privilege("areas_high_limit", { - description = SL("Can can more, bigger areas.") + description = S("Can protect more, bigger areas."), + give_to_singleplayer = false }) if not minetest.registered_privileges[areas.config.self_protection_privilege] then minetest.register_privilege(areas.config.self_protection_privilege, { - description = SL("Can protect areas.") + description = S("Can protect areas."), }) end diff --git a/mods/_various/areas/interact.lua b/mods/_various/areas/interact.lua index f17dbc22f..9cd44e2cc 100644 --- a/mods/_various/areas/interact.lua +++ b/mods/_various/areas/interact.lua @@ -1,4 +1,4 @@ -local SL = lord.require_intllib() +local S = minetest.get_translator("areas") local old_is_protected = minetest.is_protected function minetest.is_protected(pos, name) @@ -12,7 +12,7 @@ minetest.register_on_protection_violation(function(pos, name) if not areas:canInteract(pos, name) then local owners = areas:getNodeOwners(pos) minetest.chat_send_player(name, - ("%s "..SL("is protected by").." %s."):format( + S("@1 is protected by @2.", minetest.pos_to_string(pos), table.concat(owners, ", "))) end diff --git a/mods/_various/areas/internal.lua b/mods/_various/areas/internal.lua index f71a2ab20..f399bc24d 100644 --- a/mods/_various/areas/internal.lua +++ b/mods/_various/areas/internal.lua @@ -1,4 +1,4 @@ -local SL = lord.require_intllib() +local S = minetest.get_translator("areas") function areas:player_exists(name) return minetest.get_auth_handler().get_auth(name) ~= nil @@ -42,15 +42,16 @@ local function findFirstUnusedIndex(t) return i end --- Add a area, returning the new area's id. +--- Add a area. +-- @return The new area's ID. function areas:add(owner, name, pos1, pos2, parent) local id = findFirstUnusedIndex(self.areas) self.areas[id] = {name=name, pos1=pos1, pos2=pos2, owner=owner, - parent=parent} + parent=parent} return id end --- Remove a area, and optionally it's children recursively. +--- Remove a area, and optionally its children recursively. -- If a area is deleted non-recursively the children will -- have the removed area's parent as their new parent. function areas:remove(id, recurse) @@ -76,24 +77,30 @@ function areas:remove(id, recurse) self.areas[id] = nil end --- Checks if a area between two points is entirely contained by another area +-- Checks if a area between two points is entirely contained by another area. +-- Positions must be sorted. function areas:isSubarea(pos1, pos2, id) local area = self.areas[id] if not area then return false end - local p1, p2 = area.pos1, area.pos2 - if (pos1.x >= p1.x and pos1.x <= p2.x) and - (pos2.x >= p1.x and pos2.x <= p2.x) and - (pos1.y >= p1.y and pos1.y <= p2.y) and - (pos2.y >= p1.y and pos2.y <= p2.y) and - (pos1.z >= p1.z and pos1.z <= p2.z) and - (pos2.z >= p1.z and pos2.z <= p2.z) then + local ap1, ap2 = area.pos1, area.pos2 + local ap1x, ap1y, ap1z = ap1.x, ap1.y, ap1.z + local ap2x, ap2y, ap2z = ap2.x, ap2.y, ap2.z + local p1x, p1y, p1z = pos1.x, pos1.y, pos1.z + local p2x, p2y, p2z = pos2.x, pos2.y, pos2.z + if + (p1x >= ap1x and p1x <= ap2x) and + (p2x >= ap1x and p2x <= ap2x) and + (p1y >= ap1y and p1y <= ap2y) and + (p2y >= ap1y and p2y <= ap2y) and + (p1z >= ap1z and p1z <= ap2z) and + (p2z >= ap1z and p2z <= ap2z) then return true end end --- Returns a table (list) of children of an area given it's identifier +-- Returns a table (list) of children of an area given its identifier function areas:getChildren(id) local children = {} for cid, area in pairs(self.areas) do @@ -117,8 +124,10 @@ function areas:canPlayerAddArea(pos1, pos2, name) -- Check self protection privilege, if it is enabled, -- and if the area is too big. - if not self.config.self_protection or not privs[areas.config.self_protection_privilege] then - return false, SL("Self protection is disabled or you do not have the necessary privilege.") + if not self.config.self_protection or + not privs[areas.config.self_protection_privilege] then + return false, S("Self protection is disabled or you do not have" + .." the necessary privilege.") end local max_size = privs.areas_high_limit and @@ -128,7 +137,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, SL("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 @@ -142,15 +151,16 @@ 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, SL("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 -- Check intersecting areas local can, id = self:canInteractInArea(pos1, pos2, name) if not can then local area = self.areas[id] - return false, (SL("The area intersects with").." %s [%u] (%s).") - :format(area.name, id, area.owner) + return false, S("The area intersects with @1 [@2] (@3).", + area.name, id, area.owner) end return true diff --git a/mods/_various/areas/legacy.lua b/mods/_various/areas/legacy.lua index 8caba79bb..2f333fe66 100644 --- a/mods/_various/areas/legacy.lua +++ b/mods/_various/areas/legacy.lua @@ -1,25 +1,26 @@ -local SL = lord.require_intllib() -- This file contains functions to convert from -- the old areas format and other compatability code. +local S = minetest.get_translator("areas") minetest.register_chatcommand("legacy_load_areas", { - params = "", - description = SL("Loads, converts, and saves the areas from a legacy save file."), + params = S(""), + 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() + local 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: @1", 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,20 +35,21 @@ 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 }) function areas:node_ownership_load() local filename = minetest.get_worldpath().."/owners.tbl" + local tables, err tables, err = loadfile(filename) if err then return err @@ -104,35 +106,3 @@ function areas.hasOwner(pos) end return false end - -IsPlayerNodeOwner = areas.isNodeOwner -GetNodeOwnerName = areas.getNodeOwnerName -HasOwner = areas.hasOwner - --- This is entirely untested and may break in strange and new ways. -if areas.config.legacy_table then - owner_defs = setmetatable({}, { - __index = function(table, key) - local a = rawget(areas.areas, key) - if not a then return a end - local b = {} - for k, v in pairs(a) do b[k] = v end - b.x1, b.y1, b.z1 = b.pos1.x, b.pos1.y, b.pos1.z - b.x2, b.y1, b.z2 = b.pos2.x, b.pos2.y, b.pos2.z - b.pos1, b.pos2 = nil, nil - b.id = key - return b - end, - __newindex = function(table, key, value) - local a = value - a.pos1, a.pos2 = {x=a.x1, y=a.y1, z=a.z1}, - {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.id = nil - return rawset(areas.areas, key, a) - end - }) -end - diff --git a/mods/_various/areas/locale/areas.fr.tr b/mods/_various/areas/locale/areas.fr.tr new file mode 100644 index 000000000..bbbc089e9 --- /dev/null +++ b/mods/_various/areas/locale/areas.fr.tr @@ -0,0 +1,135 @@ +# textdomain: areas + + + +### chatcommands.lua ### + += + [faction_name]= [nom_de_faction] += += += += +@1 has given you control over the area "@2" (ID @3).=@1 vous a donné le contrôle de la zone "@2" (ID @3). +@1 spanning up to @2x@3x@4.=@1 s’étendant jusqu’à @2x@3x@4. +A regular expression is required.=Une expression régulière est requise. +Area @1 does not exist or is not owned by you.=La zone @1 n’existe pas ou ne vous appartient pas. +Area closed for faction members.=Zone fermée aux membres de la faction. +Area closed.=Zone fermée. +Area does not exist.=La zone n’existe pas. +Area is open for members of: @1=Zone ouverte aux membres de ces factions : @1 +Area opened.=Zone ouverte. +Area protected. ID: @1=Zone protégée. ID : @1 +Area renamed.=Zone renommée. +Area successfully moved.=Zone déplacée avec succès. +Change the owner of an area using its ID=Change le propriétaire d’une zone en utilisant son ID. +Faction doesn't exists=La faction n'existe pas +Find areas using a Lua regular expression=Trouve les zones en utilisant une expression régulière Lua. +Get information about area configuration and usage.=Obtient des informations sur la configuration des zones et l’utilisation des zones. + +Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Donne au joueur accès aux sous-zones entre deux positions qui ont déjà été protégées ; utilisez set_owner si vous ne voulez pas que la zone pricipale soit définie. + +Invalid regular expression.=Expression régulière invalide. +Limit: @1 areas=Limite: @1 zones. +Limit: no area count limit=Limite: pas de limite de nombre de zones. +List your areas, or all areas if you are an admin.=Liste vos zones, ou toutes les zones si vous êtes administrateur. +Move (or resize) an area to the current positions.=Déplace (ou redimensionne) une zone aux positions actuelles. +No matches found.=Aucun résultat. +No visible areas.=Pas de zone visible. +Owner changed.=Propriétaire changé. +Players with the "@1" privilege can protect up to @2 areas=Les joueurs avec le privilège "@1" peuvent protéger jusqu’à @2 zones + +Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area=Protège une zone entre deux positions et donne à un joueur accès à cette zone sans définir la zone principale de cette zone ni aucune zone existante. + +Protect your own area=Protège votre zone. +Recursively remove areas using an ID=Supprime les zones récursivement en utilisant un ID. +Remove an area using an ID=Supprime une zone en utilisant son ID. +Removed area @1=Zone @1 supprimée. +Removed area @1 and its sub areas.=Zone @1 et ses sous-zones supprimées. +Removes all ownerless areas=Supprime toutes les zones sans propriétaire +Rename an area that you own=Renomme une zone qui vous appartient. +Self protection is disabled.=L’autoprotection est désactivée. +Self protection is enabled.=L’autoprotection est activée. +That area doesn't exist.=La zone n’existe pas. +The player "@1" does not exist.=Le joueur "@1" n’existe pas. +Toggle an area open (anyone can interact) or closed=Bascule entre zone ouverte (tout le monde peut intéragir) ou fermée. +Toggle an area open/closed for members in your faction.=Bascule entre zone ouverte/fermée pour les membres de votre faction. +You are an area administrator ("areas" privilege).=Vous êtes un administrateur de zone (privilège "areas"). +You can protect areas=Vous pouvez protéger des zones. +You can't protect that area.=Vous ne pouvez pas protéger cette zone. +You can't protect that area: @1=Vous ne pouvez pas protéger cette zone : @1. +You don't have the necessary privilege ("@1").=Vous n’avez pas le privilège nécessaire ("@1"). +You don't own that area.=Vous ne possédez pas cette zone. +You have @1 areas.=Vous avez @1 zones. + +You have been granted control over area #@1. Type /list_areas to show your areas.=Vous avez reçu l’autorisation de contrôler la zone #@1. + +You have extended area protection limits ("areas_high_limit" privilege).=Votre limite de protection de zones est étendue (privilège "areas_high_limit"). + +You have the necessary privilege ("@1").=Vous avez le privilège nécessaire ("@1"). +You need to select an area first.=Vous devez sélectionner une zone d’abord. + +### chatcommands.lua ### +### pos.lua ### + += +Invalid usage, see /help @1.=Utilisation incorrecte, voir /help @1. + +### hud.lua ### + +:open= : ouverte +Areas:=Zones : + +### init.lua ### + +Can administer areas.=Permet d’administrer des zones. +Can protect areas.=Permet de protéger des zones. +Can protect more, bigger areas.=Permet de protéger plus, et de plus grandes zones. + +### interact.lua ### + +@1 is protected by @2.=@1 est protégée par @2. + +### internal.lua ### + +Area is too big.=La zone est trop grande. + +Self protection is disabled or you do not have the necessary privilege.=L’autoprotection est désactivée ou vous n’avez pas le privilège nécessaire. + +The area intersects with @1 [@2] (@3).=La zone a une intersection avec @1 [@2] (@3). + +You have reached the maximum amount of areas that you are allowed to protect.=Vous avez atteint le nombre maximum de zones que vous êtes autorisé à protéger. + + +### legacy.lua ### + += +Converted areas saved. Done.=Zones converties sauvegardées. Fait. +Converting areas…=Conversion des zones… +Error loading legacy file: @1=Erreur lors du chargement du fichier : @1 +Invalid version number. (0 allowed)=Numéro de version invalide. (0 autorisé) +Legacy file loaded.=Fichier obsolète chargé. + +Loads, converts, and saves the areas from a legacy save file.=Charge, fait la conversion et sauvegarde les zones depuis un fichier de sauvegarde obsolète. + +Table format updated.=Format de tableau mis à jour. +unnamed=Non nommé + +### pos.lua ### + += +Area @1 selected.=Zone @1 sélectionnée. +Area position @1 set to @2=Position @1 de la zone définie à @2. +Position @1 set to @2=Position @1 définie à @2. +Position @1: =Position @1 : +Select an area by ID.=Sélectionnez une zone par son ID. +Select position @1 by punching a node.=Sélectionnez une position @1 en frappant un bloc. +Select positions by punching two nodes.=Sélectionnez une position en frappant deux blocs. + +Set area protection region position @1 to your location or the one specified=Définit la position @1 de la région de protection de zone à votre position ou à celle spécifiée. + +Set area protection region, position 1, or position 2 by punching nodes, or display the region=Définit la région de protection de zone, la position 1, ou la position 2 en frappant des blocs, ou en affichant la région. + +The area @1 does not exist.=La zone @1 n’existe pas. +Unable to get position.=Impossible d’obtenir la position. +Unknown subcommand: @1=Sous-commande inconnue : @1 diff --git a/mods/_various/areas/locale/areas.it.tr b/mods/_various/areas/locale/areas.it.tr new file mode 100644 index 000000000..006b04d23 --- /dev/null +++ b/mods/_various/areas/locale/areas.it.tr @@ -0,0 +1,135 @@ +# textdomain: areas + + + +### chatcommands.lua ### + += + [faction_name]= [nome_fazione] += += += += +@1 has given you control over the area "@2" (ID @3).=@1 ti ha dato il controllo sull'area "@2" (ID @3). +@1 spanning up to @2x@3x@4.=@1 si estende fino a @2x@3@4. +A regular expression is required.=È necessaria una espressione regolare. +Area @1 does not exist or is not owned by you.=L'area @1 non esiste o non è di tua proprietà. +Area closed for faction members.=Area chiusa per i membri della fazione. +Area closed.=Area chiusa. +Area does not exist.=L'area non esiste. +Area is open for members of: @1=L'area è aperta ai membri di: @1 +Area opened.=Area aperta. +Area protected. ID: @1=Area protetta. ID: @1 +Area renamed.=Area rinominata. +Area successfully moved.=Area spostata con successo. +Change the owner of an area using its ID=Cambia il proprietario di un'area usando il suo ID +Faction doesn't exists=La fazione non esiste +Find areas using a Lua regular expression=Trova aree usando una espressione regolare Lua +Get information about area configuration and usage.=Ottieni informazioni sulla configurazione e l'uso delle aree. + +Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Dai a un giocatore l'accesso a una sotto-area tra due posizioni che sono già state protette, usa set_owner se non vuoi che sia impostato il parent. + +Invalid regular expression.=Espressione regolare non valida. +Limit: @1 areas=Limite: @1 aree +Limit: no area count limit=Limite: nessun limite al numero delle aree +List your areas, or all areas if you are an admin.=Elenca le tue aree, o tutte le aree se sei un amministratore. +Move (or resize) an area to the current positions.=Sposta (o ridimensiona) un'area alle posizioni attuali. +No matches found.=Nessuna corrispondenza trovata. +No visible areas.=Nessuna area visibile. +Owner changed.=Proprietario cambiato. +Players with the "@1" privilege can protect up to @2 areas=I giocatori col privilegio "@1" possono proteggere fino a @2 aree + +Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area=Proteggi un'area tra due posizioni e danne l'accesso a un giocatore senza impostare il parent dell'area a qualsiasi area esistente + +Protect your own area=Proteggi la tua area +Recursively remove areas using an ID=Elimina ricorsivamente delle aree usando un ID +Remove an area using an ID=Elimina un'area usando un ID +Removed area @1=Eliminata l'area @1 +Removed area @1 and its sub areas.=Eliminata l'area @1 e le sue sotto-aree. +Removes all ownerless areas= +Rename an area that you own=Rinomina un'area che ti appartiene +Self protection is disabled.=L'auto-protezione è disattivata. +Self protection is enabled.=L'auto-protezione è attivata. +That area doesn't exist.=Quell'area non esiste. +The player "@1" does not exist.=Il giocatore "@1" non esiste. +Toggle an area open (anyone can interact) or closed=Apri o chiudi un'area (chiunque può interagirvi) +Toggle an area open/closed for members in your faction.=Apri o chiudi un'area per i membri della tua fazione. +You are an area administrator ("areas" privilege).=Sei un amministratore di aree (privilegio "areas") +You can protect areas=Puoi proteggere aree +You can't protect that area.=Non puoi proteggere quell'area. +You can't protect that area: @1=Non puoi proteggere quell'area: @1 +You don't have the necessary privilege ("@1").=Non hai il privilegio necessario ("@1") +You don't own that area.=Non possiedi quell'area. +You have @1 areas.=Hai @1 aree. + +You have been granted control over area #@1. Type /list_areas to show your areas.=Ti è stato concesso il controllo sull'area #@1. Digita /list_areas per mostrare le tue aree. + +You have extended area protection limits ("areas_high_limit" privilege).=Hai limiti di protezione aree estesi (privilegio "areas_high_limit") + +You have the necessary privilege ("@1").=Hai il privilegio necessario ("@1") +You need to select an area first.=Prima devi selezionare un'area. + +### chatcommands.lua ### +### pos.lua ### + += +Invalid usage, see /help @1.=Utilizzo non valido, si veda /help @1. + +### hud.lua ### + +:open=:aperta +Areas:=Aree: + +### init.lua ### + +Can administer areas.= +Can protect areas.= +Can protect more, bigger areas.= + +### interact.lua ### + +@1 is protected by @2.=@1 è protetta da @2. + +### internal.lua ### + +Area is too big.=L'area è troppo grande. + +Self protection is disabled or you do not have the necessary privilege.=L'auto-protezione è disattivata o non possiedi il privilegio necessario. + +The area intersects with @1 [@2] (@3).=L'area interseca con @1 [@2] (@3). + +You have reached the maximum amount of areas that you are allowed to protect.=Hai raggiunto il numero massimo di aree che ti è consentito proteggere. + + +### legacy.lua ### + += +Converted areas saved. Done.=Aree convertite salvate. Fatto. +Converting areas…=Conversione delle aree... +Error loading legacy file: @1=Errore nel caricamento del file precedente: @1 +Invalid version number. (0 allowed)=Numero di versione non valido. (0 permesso) +Legacy file loaded.=File precedente caricato. + +Loads, converts, and saves the areas from a legacy save file.=Carica, converte e salva le aree da un file di salvataggio precedente. + +Table format updated.=Aggiornato il formato della tabella. +unnamed=innominato + +### pos.lua ### + += +Area @1 selected.=Area @1 selezionata. +Area position @1 set to @2=Posizione @1 dell'area impostata a @2 +Position @1 set to @2=Posizione @1 impostata a @2 +Position @1: =Posizione @1: +Select an area by ID.=Scegli un'area tramite l'ID. +Select position @1 by punching a node.=Seleziona la posizione @1 colpendo un nodo. +Select positions by punching two nodes.=Seleziona le posizioni colpendo due nodi. + +Set area protection region position @1 to your location or the one specified=Imposta la protezione area della posizione @1 della regione alla tua posizione o quella specificata + +Set area protection region, position 1, or position 2 by punching nodes, or display the region=Imposta la protezione area della regione, posizione 1, o posizione 2, colpendo due nodi, o mostra la regione + +The area @1 does not exist.=L'area @1 non esiste. +Unable to get position.=Impossibile ottenere la posizione. +Unknown subcommand: @1=Sotto-comando sconosciuto: @1 diff --git a/mods/_various/areas/locale/areas.ru.tr b/mods/_various/areas/locale/areas.ru.tr new file mode 100644 index 000000000..171ecb0d2 --- /dev/null +++ b/mods/_various/areas/locale/areas.ru.tr @@ -0,0 +1,135 @@ +# textdomain: areas + + + +### chatcommands.lua ### + +=<имя_территории> + [faction_name]= [имя_фракции] +=<новый_владелец> += +=<имя_игрока> +=<новое_имя> +@1 has given you control over the area "@2" (ID @3).=@1 передал вам территорию "@2" (ID @3). +@1 spanning up to @2x@3x@4.=@1 размером до @2x@3x@4. +A regular expression is required.=Не указано регулярное выражение. +Area @1 does not exist or is not owned by you.=Территория @1 не существует или Вы не имеете к ней доступа. +Area closed for faction members.=Территория закрыта для фракций. +Area closed.=Территория закрыта. +Area does not exist.=Территория не существует. +Area is open for members of: @1=Территория открыта для игроков из фракций: @1 +Area opened.=Территория открыта. +Area protected. ID: @1=Территория защищена. ID: @1 +Area renamed.=Территория переименована. +Area successfully moved.=Территория успешно перенесена. +Change the owner of an area using its ID=Изменить владельца территории по её ID +Faction doesn't exists=Фракция не существует. +Find areas using a Lua regular expression=Поиск территорий с использованием регулярных выражений Lua +Get information about area configuration and usage.=Получить информацию о конфигурации и использовании защиты территорий. + +Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.=Дать игроку доступ к выделенной территории, создав дополнительный регион. Используйте set_owner, если вы не хотите привязки к родительской территории. + +Invalid regular expression.=Неверное регулярное выражение. +Limit: @1 areas=Ограничение: @1 территорий(я) +Limit: no area count limit=Ограничение: нет ограничений на кол-во территорий +List your areas, or all areas if you are an admin.=Вывести список доступных Вам территорий (или всех существующих территорий, если Вы имеете привилегию areas) +Move (or resize) an area to the current positions.=Переместить (или изменить размер) территории. +No matches found.=Совпадений не найдено. +No visible areas.=Нет доступных территорий. +Owner changed.=Владелец изменён. +Players with the "@1" privilege can protect up to @2 areas=Игроки, имеющие привилегию "@1" могут защищать до @2 территорий + +Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area=Защитить территорию между двумя позициями и дать игроку доступ к ней без привязки к родительскому региону. + +Protect your own area=Защитить территорию и установить себя владельцем +Recursively remove areas using an ID=Recursively remove areas using an ID +Remove an area using an ID=Рекурсивное удаление территорий (вместе с дочерними) по его ID +Removed area @1=Удалена территория @1 +Removed area @1 and its sub areas.=Удалена территория @1 и её дочерние территории. +Removes all ownerless areas=Удалить все бесхозные территории (без владельца) +Rename an area that you own=Переименовать территорию, которой вы владеете. +Self protection is disabled.=Защита своих территорий отключена. +Self protection is enabled.=Защита своих территорий включена. +That area doesn't exist.=Территория не существует. +The player "@1" does not exist.=Игрок "@1" не существует. +Toggle an area open (anyone can interact) or closed=Открыть/закрыть территорию для других игроков +Toggle an area open/closed for members in your faction.=Открыть/закрыть территорию для игроков вашей фракции. +You are an area administrator ("areas" privilege).=Вы можете управлять всеми территориями (привилегия "areas") +You can protect areas=Вы можете защищать территории +You can't protect that area.=Вы не можете установить защиту на эту территорию. +You can't protect that area: @1=Вы не можете установить защиту на территорию: @1 +You don't have the necessary privilege ("@1").=У Вас нет необходимой привилегии ("@1"). +You don't own that area.=Вы не являетесь владельцем этой территории. +You have @1 areas.=У вас @1 территорий. + +You have been granted control over area #@1. Type /list_areas to show your areas.=Вам выдан доступ к территории #@1. + +You have extended area protection limits ("areas_high_limit" privilege).=У вас увеличенный лимит на кол-во создаваемых вами защищённых территорий + +You have the necessary privilege ("@1").=У вас есть необходимая привилегия ("@1"). +You need to select an area first.=Сначала необходимо выделить территорию. + +### chatcommands.lua ### +### pos.lua ### + += +Invalid usage, see /help @1.=Неверное использование, см. /help @1. + +### hud.lua ### + +:open=:открытая +Areas:=Территории: + +### init.lua ### + +Can administer areas.=Может управлять территориями. +Can protect areas.=Может создавать защищённые территории. +Can protect more, bigger areas.=Может создавать защищённые территории больше территорий и с бОльшим размером. + +### interact.lua ### + +@1 is protected by @2.=@1 - принадлежит @2. + +### internal.lua ### + +Area is too big.=Территория слишком велика. + +Self protection is disabled or you do not have the necessary privilege.=Возможность защиты территорий отключена или же Вы не имеете необходимых привилегий. + +The area intersects with @1 [@2] (@3).=Территория пересекается с @1 [@2] (@3). + +You have reached the maximum amount of areas that you are allowed to protect.=Вы достигли максимально допустимого количества на создание защищённых территорий. + + +### legacy.lua ### + +=<версия> +Converted areas saved. Done.=Готово. Сконвертированные территории сохранены. +Converting areas…=Конвертирование территорий… +Error loading legacy file: @1=Ошибка загрузки файла с устаревшим форматом: @1 +Invalid version number. (0 allowed)=Неверный номер версии. (поддерживается 0) +Legacy file loaded.=Файл с устаревшим форматом загружен. + +Loads, converts, and saves the areas from a legacy save file.=Загружает, конвертирует и сохраняет файл с устаревшим форматом. + +Table format updated.=Формат обновлён. +unnamed=<без_названия> + +### pos.lua ### + +=<не_установлена> +Area @1 selected.=Территория @1 выбрана. +Area position @1 set to @2=Позиция @1 установлена в @2 +Position @1 set to @2=Позиция @1 установлена в @2 +Position @1: =Позиция @1: +Select an area by ID.=Выбрать территорию по её ID. +Select position @1 by punching a node.=Установите позицию @1, ударив по блоку. +Select positions by punching two nodes.=Установите позиции, ударив по двум блокам. + +Set area protection region position @1 to your location or the one specified=Установить позицию @1 для выбора защищаемой территории + +Set area protection region, position 1, or position 2 by punching nodes, or display the region=Установить позиции 1 и/или 2, ударяя по блокам, или вывести ранее установленные позиции + +The area @1 does not exist.=Территория @1 не существует. +Unable to get position.=Не удалось получить позицию. +Unknown subcommand: @1=Неизвестная под-команда/аргумент. diff --git a/mods/_various/areas/locale/en.txt b/mods/_various/areas/locale/en.txt deleted file mode 100644 index 89dbb017a..000000000 --- a/mods/_various/areas/locale/en.txt +++ /dev/null @@ -1,90 +0,0 @@ -### init.lua ### -Can administer areas. = Can administer areas. -Can can more, bigger areas. = Can can more, bigger areas. -Can protect areas. = Can protect areas. - -### internal.lua ### -Self protection is disabled or you do not have the necessary privilege. -Area is too big. = Area is too big. -You have reached the maximum amount of areas that you are allowed to protect. = You have reached the maximum amount of areas that you are allowed to protect. -The area intersects with = The area intersects with - -### chatcommands.lua ### -Protect your own area = Protect your own area -Invalid usage, see = Invalid usage, see -You need to select an area first. = You need to select an area first. -You can't protect that area = You can't protect that area -Area protected. = Area protected. -Protect an area beetween two positions and give a player access to it without setting the parent of the area to any existing area = Protect an area beetween two positions and give a player access to it without setting the parent of the area to any existing area -The player = The player -does not exist. = does not exist. -You have been granted control over area # = You have been granted control over area # -. Type /list_areas to show your areas. = . Type /list_areas to show your areas. -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. = 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. -Rename a area that you own = Rename a area that you own -That area doesn't exist. = That area doesn't exist. -You don't own that area. = You don't own that area. -Area renamed. = Area renamed. -Find areas using a Lua regular expression = Find areas using a Lua regular expression -A regular expression is required. = A regular expression is required. -Invalid regular expression. = Invalid regular expression. -No matches found. = No matches found. -List your areas, or all areas if you are an admin = List your areas, or all areas if you are an admin -No visible areas. = No visible areas. -Recursively remove areas using an id = Recursively remove areas using an id -Area = Area -does not exist or is not owned by you. = does not exist or is not owned by you. -Removed area = Removed area -and it's sub areas. = and it's sub areas. -Remove an area using an id = Remove an area using an id -Change the owner of an area using it's ID = Change the owner of an area using it's ID -has given you control over the area = has given you control over the area -Owner changed. = Owner changed. -Toggle an area open (anyone can interact) or closed = Toggle an area open (anyone can interact) or closed -opened = opened -closed = closed -Move (or resize) an area to the current positions. = Move (or resize) an area to the current positions. -Area successfully moved. = Area successfully moved. -Get information about area configuration and usage. = Get information about area configuration and usage. -Self protection is disabled = Self protection is disabled -Self protection is enabled = Self protection is enabled -have the neccessary privilege = have the neccessary privilege -and you = and you -but you don't = but you don't -You are an area administrator = You are an area administrator -You have extended area protection limits = You have extended area protection limits -privilege). = privilege). -area = area -areas = areas -Number of your areas: = Number of your areas: -you have no area protection limits. = you have no area protection limits. -the maximum number = the maximum number -spanning up to = spanning up to -Players with the = Players with the -privilege = privilege -can protect up to = can protect up to -You can protect areas = You can protect areas - -### pos.lua ### -Select a area by id. = Select a area by id. -The area = The area -selected. = selected. -Set area protection region position 1 to your location or the one specified = Set area protection region position 1 to your location or the one specified -Unable to get position. = Unable to get position. -Area position 1 set to = Area position 1 set to -Set area protection region position 2 to your location or the one specified = Set area protection region position 2 to your location or the one specified -Area position 2 set to = Area position 2 set to -Set area protection region, position 1, or position 2 by punching nodes, or display the region = Set area protection region, position 1, or position 2 by punching nodes, or display the region -Select positions by punching two nodes. = Select positions by punching two nodes. -Select position 1 by punching a node. = Select position 1 by punching a node. -Select position 2 by punching a node. = Select position 2 by punching a node. -Position = Position -Unknown subcommand = Unknown subcommand -set to = set to - -### interact.lua ### -is protected by = is protected by - -### hud.lua ### -:open = :open -Areas: = Areas: diff --git a/mods/_various/areas/locale/ru.txt b/mods/_various/areas/locale/ru.txt deleted file mode 100644 index 72cd7ac3c..000000000 --- a/mods/_various/areas/locale/ru.txt +++ /dev/null @@ -1,93 +0,0 @@ -### init.lua ### -Can administer areas. = Возможность управлять территориями -Can can more, bigger areas. = Возможность защищать большие территории -Can protect areas. = Возможность защищать территории - -### internal.lua ### -Self protection is disabled or you do not have the necessary privilege. = Возможность защиты территорий отключена или же Вы не имеете соответствующией привилегии. -Area is too big. = Территория слишком велика. -You have reached the maximum amount of areas that you are allowed to protect. = Вы достигли максимального количества защищённых территорий. -The area intersects with = Территория пересекается с - -### chatcommands.lua ### -Protect your own area = Защитить территорию -Invalid usage, see = Ошибка использования, смотрите -You need to select an area first. = Сначала нужно выбрать территорию. -You can't protect that area = Вы не можите защитить территорию -Area protected. = Территория защищена. -Protect an area beetween two positions and give a player access to it without setting the parent of the area to any existing area = Дать игроку доступ к выделенной территории без создания дополнительного региона. -The player = Игрока с именем -does not exist. = не существует. -You have been granted control over area # = Вы получили доступ к территории # -. Type /list_areas to show your areas. = . Используйте /list_areas для просмотра доступных территорий. -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. = Дать игроку доступ к выделенной территории, создав дополнительный регион. -Rename a area that you own = Переименовать территорию -That area doesn't exist. = Указанная территория не существует. -You don't own that area. = Эта территория Вам не доступна. -Area renamed. = Территория переименована. -Find areas using a Lua regular expression = Поиск территорий с использованием регулярных выражений LUA -A regular expression is required. = Не указано регулярное выражение. -Invalid regular expression. = Ошибка в регулярном выражении. -No matches found. = Совпадений не найдено. -List your areas, or all areas if you are an admin = Вывести список доступных Вам территорий (или всех существующих территорий, если Вы имеете привилегию areas) -No visible areas. = Нет доступных территорий. -Recursively remove areas using an id = Удалить территорию по её ID (вместе с её дополнительными регионами) -Area = Территория -does not exist or is not owned by you. = не существует или Вы не имеете к ней доступа. -Removed area = Удалена территория -and it's sub areas. = и её дополнительные регионы. -Remove an area using an id = Удалить территорию по её ID -Change the owner of an area using it's ID = Изменить владельца территории по её ID -has given you control over the area = передал вам территорию -Owner changed. = Владелец изменён. -Toggle an area open (anyone can interact) or closed = Открыть/закрыть территорию для других игроков -opened = открыта -closed = закрыта -Move (or resize) an area to the current positions. = Переместить (или изменить размер) территории. -Area successfully moved. = Территория успешно перенесена. -Get information about area configuration and usage. = Получить информацию о конфигурации и использовании защиты территорий -Self protection is disabled = Защита территорий отключена -Self protection is enabled = Защита территорий включена -have the neccessary privilege = имеете необходимые привилегии -and you = и Вы -but you don't = но Вы не -You are an area administrator = Вы можете управлять чужими территориями -You have extended area protection limits = Вы можете работать с большими территориями -privilege). = привилегия). -area = территорию -areas = территорий -Number of your areas: = Количесвто Ваших территорий: -you have no area protection limits. = Вы не ограничены в их количестве. -the maximum number = максимальное количество -spanning up to = размером до -Players with the = Игроки, имеющие -privilege = привилегию, -can protect up to = могут защищать до -You can protect areas = Вы можете защищать территории - -### pos.lua ### -Select a area by id. = Выбрать территорию по её ID. -The area = Территория -selected. = выбрана. -Set area protection region position 1 to your location or the one specified = Установить позицию 1 для выбора защищаемой территории -Unable to get position. = Не удалось получить позицию. -Area position 1 set to = Позиция 1 установлена в -Set area protection region position 2 to your location or the one specified = Установить позицию 2 для выбора защищаемой территории -Area position 2 set to = Позиция 2 установлена в -Set area protection region, position 1, or position 2 by punching nodes, or display the region = Установить позиции 1 и/или 2, или вывести ранее установленные позиции -Select positions by punching two nodes. = Установите позиции, ударив по двум узлам. -Select position 1 by punching a node. = Установите позицию 1, ударив по узлу. -Select position 2 by punching a node. = Установите позицию 2, ударив по узлу. -Position = Позиция -Unknown subcommand = Неизвестная команда -set to = установлена в - -### interact.lua ### -is protected by = - принадлежит - -### hud.lua ### -:open = :открыто -Areas: = Территории: - -### legacy.lua ### -Loads, converts, and saves the areas from a legacy save file. = Загружает, конвертирует и сохраняет области из старого файла сохранения. \ No newline at end of file diff --git a/mods/_various/areas/locale/template.txt b/mods/_various/areas/locale/template.txt new file mode 100644 index 000000000..2026c5e17 --- /dev/null +++ b/mods/_various/areas/locale/template.txt @@ -0,0 +1,135 @@ +# textdomain: areas + + + +### chatcommands.lua ### + += + [faction_name]= += += += += +@1 has given you control over the area "@2" (ID @3).= +@1 spanning up to @2x@3x@4.= +A regular expression is required.= +Area @1 does not exist or is not owned by you.= +Area closed for faction members.= +Area closed.= +Area does not exist.= +Area is open for members of: @1= +Area opened.= +Area protected. ID: @1= +Area renamed.= +Area successfully moved.= +Change the owner of an area using its ID= +Faction doesn't exists= +Find areas using a Lua regular expression= +Get information about area configuration and usage.= + +Give a player access to a sub-area between two positions that have already been protected, Use set_owner if you don't want the parent to be set.= + +Invalid regular expression.= +Limit: @1 areas= +Limit: no area count limit= +List your areas, or all areas if you are an admin.= +Move (or resize) an area to the current positions.= +No matches found.= +No visible areas.= +Owner changed.= +Players with the "@1" privilege can protect up to @2 areas= + +Protect an area between two positions and give a player access to it without setting the parent of the area to any existing area= + +Protect your own area= +Recursively remove areas using an ID= +Remove an area using an ID= +Removed area @1= +Removed area @1 and its sub areas.= +Removes all ownerless areas= +Rename an area that you own= +Self protection is disabled.= +Self protection is enabled.= +That area doesn't exist.= +The player "@1" does not exist.= +Toggle an area open (anyone can interact) or closed= +Toggle an area open/closed for members in your faction.= +You are an area administrator ("areas" privilege).= +You can protect areas= +You can't protect that area.= +You can't protect that area: @1= +You don't have the necessary privilege ("@1").= +You don't own that area.= +You have @1 areas.= + +You have been granted control over area #@1. Type /list_areas to show your areas.= + +You have extended area protection limits ("areas_high_limit" privilege).= + +You have the necessary privilege ("@1").= +You need to select an area first.= + +### chatcommands.lua ### +### pos.lua ### + += +Invalid usage, see /help @1.= + +### hud.lua ### + +:open= +Areas:= + +### init.lua ### + +Can administer areas.= +Can protect areas.= +Can protect more, bigger areas.= + +### interact.lua ### + +@1 is protected by @2.= + +### internal.lua ### + +Area is too big.= + +Self protection is disabled or you do not have the necessary privilege.= + +The area intersects with @1 [@2] (@3).= + +You have reached the maximum amount of areas that you are allowed to protect.= + + +### legacy.lua ### + += +Converted areas saved. Done.= +Converting areas…= +Error loading legacy file: @1= +Invalid version number. (0 allowed)= +Legacy file loaded.= + +Loads, converts, and saves the areas from a legacy save file.= + +Table format updated.= +unnamed= + +### pos.lua ### + += +Area @1 selected.= +Area position @1 set to @2= +Position @1 set to @2= +Position @1: = +Select an area by ID.= +Select position @1 by punching a node.= +Select positions by punching two nodes.= + +Set area protection region position @1 to your location or the one specified= + +Set area protection region, position 1, or position 2 by punching nodes, or display the region= + +The area @1 does not exist.= +Unable to get position.= +Unknown subcommand: @1= diff --git a/mods/_various/areas/pos.lua b/mods/_various/areas/pos.lua index 045166489..9cb96b311 100644 --- a/mods/_various/areas/pos.lua +++ b/mods/_various/areas/pos.lua @@ -1,4 +1,4 @@ -local SL = lord.require_intllib() +local S = minetest.get_translator("areas") -- I could depend on WorldEdit for this, but you need to have the 'worldedit' -- permission to use those commands and you don't have @@ -13,31 +13,31 @@ areas.pos1 = {} areas.pos2 = {} minetest.register_chatcommand("select_area", { - params = "", - description = SL("Select a area by id."), + params = S(""), + description = S("Select an area by ID."), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) local id = tonumber(param) if not id then - return false, SL("Invalid usage, see").." /help select_area." + return false, S("Invalid usage, see /help @1.", "select_area") end if not areas.areas[id] then - return false, SL("The area").." "..id.." "..SL("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, SL("Area").." "..id.." "..SL("selected.") + return true, S("Area @1 selected.", id) end, }) minetest.register_chatcommand("area_pos1", { params = "[X Y Z|X,Y,Z]", - description = SL("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", "1"), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) - local pos = nil + local pos local found, _, x, y, z = param:find( "^(-?%d+)[, ](-?%d+)[, ](-?%d+)$") if found then @@ -47,24 +47,25 @@ minetest.register_chatcommand("area_pos1", { if player then pos = player:get_pos() else - return false, SL("Unable to get position.") + return false, S("Unable to get position.") end else - return false, SL("Invalid usage, see").." /help area_pos1." + return false, S("Invalid usage, see /help @1.", "area_pos1") end pos = vector.round(pos) areas:setPos1(name, pos) - return true, SL("Area position 1 set to").." "..minetest.pos_to_string(pos) + return true, S("Area position @1 set to @2", "1", + minetest.pos_to_string(pos)) end, }) minetest.register_chatcommand("area_pos2", { params = "[X Y Z|X,Y,Z]", - description = SL("Set area protection region position 2 to your" - .." location or the one specified"), + description = S("Set area protection region position @1 to your" + .." location or the one specified", "2"), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) - local pos = nil + local pos local found, _, x, y, z = param:find( "^(-?%d+)[, ](-?%d+)[, ](-?%d+)$") if found then @@ -74,48 +75,49 @@ minetest.register_chatcommand("area_pos2", { if player then pos = player:get_pos() else - return false, SL("Unable to get position.") + return false, S("Unable to get position.") end else - return false, SL("Invalid usage, see").." /help area_pos2." + return false, S("Invalid usage, see /help @1.", "area_pos2") end pos = vector.round(pos) areas:setPos2(name, pos) - return true, SL("Area position 2 set to").." "..minetest.pos_to_string(pos) + return true, S("Area position @1 set to @2", "2", + minetest.pos_to_string(pos)) end, }) minetest.register_chatcommand("area_pos", { params = "set/set1/set2/get", - description = SL("Set area protection region, position 1, or position 2" + description = S("Set area protection region, position 1, or position 2" .." by punching nodes, or display the region"), privs = {[areas.config.self_protection_privilege]=true}, func = function(name, param) if param == "set" then -- Set both area positions areas.set_pos[name] = "pos1" - return true, SL("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, SL("Select position 1 by punching a node.") + return true, S("Select position @1 by punching a node.", "1") elseif param == "set2" then -- Set area position 2 areas.set_pos[name] = "pos2" - return true, SL("Select position 2 by punching a node.") + return true, S("Select position @1 by punching a node.", "2") elseif param == "get" then -- Display current area positions - local pos1str, pos2str = SL("Position").." 1: ", SL("Position").." 2: " + local pos1str, pos2str = S("Position @1: ", "1"), S("Position @1: ", "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, SL("Unknown subcommand")..": "..param + return false, S("Unknown subcommand: @1", param) end end, }) @@ -151,19 +153,22 @@ minetest.register_on_punchnode(function(pos, node, puncher) areas.markPos1(name) areas.set_pos[name] = "pos2" minetest.chat_send_player(name, - SL("Position").." 1 "..SL("set to").." "..minetest.pos_to_string(pos)) + S("Position @1 set to @2", "1", + 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, - SL("Position").." 1 "..SL("set to").." "..minetest.pos_to_string(pos)) + S("Position @1 set to @2", "1", + 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, - SL("Position").." 2 "..SL("set to").." "..minetest.pos_to_string(pos)) + S("Position @1 set to @2", "2", + minetest.pos_to_string(pos))) end end end)