From 62bb1cc5efd0df3582c14ed9cd66ceaeba3b78cd Mon Sep 17 00:00:00 2001 From: Alexander Chibrikin Date: Thu, 19 Oct 2023 17:21:00 +0300 Subject: [PATCH] Add `wand.lua` translarion. Some fixes for translations: - add missed `count` var - fix terminology "blocks" -> "nodes" for `//outset` `//inset` - change textdomain `worldedit` -> `worldedit_commands` - add missed translation ("invalid usage") in `//cubeapply` --- worldedit_commands/cuboid.lua | 8 ++++---- worldedit_commands/init.lua | 4 ++-- worldedit_commands/locale/template.txt | 10 +++++++--- worldedit_commands/locale/worldedit.ru.tr | 10 +++++++--- worldedit_commands/safe.lua | 2 +- worldedit_commands/wand.lua | 4 +++- 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/worldedit_commands/cuboid.lua b/worldedit_commands/cuboid.lua index 050cf94..1da5d98 100644 --- a/worldedit_commands/cuboid.lua +++ b/worldedit_commands/cuboid.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("worldedit") +local S = minetest.get_translator("worldedit_commands") worldedit.register_command("outset", { params = "[h/v] ", @@ -34,7 +34,7 @@ worldedit.register_command("outset", { end worldedit.marker_update(name) - return true, S("Region outset by @1 blocks", amount) + return true, S("Region outset by @1 nodes", amount) end, }) @@ -71,7 +71,7 @@ worldedit.register_command("inset", { end worldedit.marker_update(name) - return true, S("Region inset by @1 blocks", amount) + return true, S("Region inset by @1 nodes", amount) end, }) @@ -232,7 +232,7 @@ worldedit.register_command("cubeapply", { end local cmddef = worldedit.registered_commands[cmd] if cmddef == nil or cmddef.require_pos ~= 2 then - return false, "invalid usage: //" .. cmd .. " cannot be used with cubeapply" + return false, S("invalid usage: //@1 cannot be used with cubeapply", cmd) end -- run parsing of target command local parsed = {cmddef.parse(args)} diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index c1d81ea..2dda953 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("worldedit") +local S = minetest.get_translator("worldedit_commands") minetest.register_privilege("worldedit", S("Can use WorldEdit commands")) @@ -1449,7 +1449,7 @@ worldedit.register_command("save", { file:flush() file:close() - worldedit.player_notify(name, S("@1 nodes saved")) + worldedit.player_notify(name, S("@1 nodes saved", count)) end, }) diff --git a/worldedit_commands/locale/template.txt b/worldedit_commands/locale/template.txt index b11a353..d9a40a8 100644 --- a/worldedit_commands/locale/template.txt +++ b/worldedit_commands/locale/template.txt @@ -1,4 +1,4 @@ -# textdomain: worldedit +# textdomain: worldedit_commands ### init.lua ### Can use WorldEdit commands= @@ -137,9 +137,9 @@ Abort a pending operation= Outset the selected region.= Invalid direction: @1= Invalid number of arguments= -Region outset by @1 blocks= +Region outset by @1 nodes= Inset the selected region.= -Region inset by @1 blocks= +Region inset by @1 nodes= Shifts the selection area without moving its contents= Invalid if looking straight up or down= Region shifted by @1 nodes= @@ -148,4 +148,8 @@ Region expanded by @1 nodes= Contracts the selection in the selected absolute or relative axis= Region contracted by @1 nodes= Select a cube with side length around position 1 and run on region= +invalid usage: //@1 cannot be used with cubeapply= Missing privileges: @1= + +### wand.lua ### +WorldEdit Wand tool@\nLeft-click to set 1st position, right-click to set 2nd= diff --git a/worldedit_commands/locale/worldedit.ru.tr b/worldedit_commands/locale/worldedit.ru.tr index 0f19659..9c86b08 100644 --- a/worldedit_commands/locale/worldedit.ru.tr +++ b/worldedit_commands/locale/worldedit.ru.tr @@ -1,4 +1,4 @@ -# textdomain: worldedit +# textdomain: worldedit_commands ### init.lua ### Can use WorldEdit commands=Возможность редактировать мир с помощью команд WorldEdit @@ -137,9 +137,9 @@ Abort a pending operation=Отклонить отложенную операци Outset the selected region.=Расширить выделение региона. Invalid direction: @1=Недопустимое направление: @1 Invalid number of arguments=Недопустимое количество аргументов -Region outset by @1 blocks=Регион расширен на @1 блок(а/ов) +Region outset by @1 nodes=Регион расширен на @1 нод(у/ы) Inset the selected region.=Сузить выделение региона. -Region inset by @1 blocks=Регион сужен на @1 блок(а/ов) +Region inset by @1 nodes=Регион сужен на @1 нод(у/ы) Shifts the selection area without moving its contents=Сдвинуть выделение региона без перемещения его содержимого Invalid if looking straight up or down=Недопустимо, если смотреть прямо вверх или вниз Region shifted by @1 nodes=Регион сдвинут на @1 нод(у/ы) @@ -148,4 +148,8 @@ Region expanded by @1 nodes=Регион увеличен на @1 нод(у/ы) Contracts the selection in the selected absolute or relative axis=Уменьшить выделение региона по выбранной абсолютной или относительной оси Region contracted by @1 nodes=Регион уменьшен на @1 нод(у/ы) Select a cube with side length around position 1 and run on region=Выделить куб с длиной стороны вокруг позиции 1 и запустите <команду> в области +invalid usage: //@1 cannot be used with cubeapply=недопустимое использование: //@1 не может быть применено в cubeapply Missing privileges: @1=Отсутствуют привилегии: @1 + +### wand.lua ### +WorldEdit Wand tool@nLeft-click to set 1st position, right-click to set 2nd=Инструмент WorldEdit Wand@nЛевая кнопка мыши, чтобы установить 1-ю позицию, правая кнопка мыши, чтобы установить 2-ю diff --git a/worldedit_commands/safe.lua b/worldedit_commands/safe.lua index 79b8445..1be4acc 100644 --- a/worldedit_commands/safe.lua +++ b/worldedit_commands/safe.lua @@ -1,4 +1,4 @@ -local S = minetest.get_translator("worldedit") +local S = minetest.get_translator("worldedit_commands") local safe_region_callback = {} diff --git a/worldedit_commands/wand.lua b/worldedit_commands/wand.lua index faa77ff..b3fdcef 100644 --- a/worldedit_commands/wand.lua +++ b/worldedit_commands/wand.lua @@ -1,3 +1,5 @@ +local S = minetest.get_translator("worldedit_commands") + local function above_or_under(placer, pointed_thing) if placer:get_player_control().sneak then return pointed_thing.above @@ -9,7 +11,7 @@ end local punched_air_time = {} minetest.register_tool(":worldedit:wand", { - description = "WorldEdit Wand tool\nLeft-click to set 1st position, right-click to set 2nd", + description = S("WorldEdit Wand tool\nLeft-click to set 1st position, right-click to set 2nd"), inventory_image = "worldedit_wand.png", stack_max = 1, -- there is no need to have more than one liquids_pointable = true, -- ground with only water on can be selected as well