From 97682b7df66e5c47643feba615325d2af3a15618 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sat, 6 Dec 2025 15:11:28 +0100 Subject: [PATCH 1/2] Add title and description to mod.conf --- mod.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mod.conf b/mod.conf index 8914ffa..a2f8f8d 100644 --- a/mod.conf +++ b/mod.conf @@ -1,4 +1,6 @@ name = stripped_tree +title = Stripped Trees +description = Adds stripped tree trunks author = 1faco depends = default optional_depends = moretrees, ethereal, moreores -- 2.49.1 From 1e1c9a0fb46c8894cf3f8d7ae343ecffd5b6efbb Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 9 Dec 2025 18:10:17 +0100 Subject: [PATCH 2/2] Make strings translatable Also add Hungarian and Spanish translations --- chiseling_machine.lua | 6 ++++-- functions.lua | 4 +++- init.lua | 4 +++- locale/stripped_tree.es.tr | 5 +++++ locale/stripped_tree.hu.tr | 5 +++++ locale/template.txt | 5 +++++ 6 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 locale/stripped_tree.es.tr create mode 100644 locale/stripped_tree.hu.tr create mode 100644 locale/template.txt diff --git a/chiseling_machine.lua b/chiseling_machine.lua index 28e55ac..e57a997 100644 --- a/chiseling_machine.lua +++ b/chiseling_machine.lua @@ -1,9 +1,11 @@ +local S = core.get_translator(core.get_current_modname()) + local max_stack = tonumber(core.settings:get("default_stack_max")) or 99 -- LuaFormatter off local machine_formspec = "" .. "size[8,9]" .. - "label[0,0;Chiseling Machine]" .. + "label[0,0;" .. core.formspec_escape(S("Chiseling Machine")) .. "]" .. "image[2,2;1,1;chisel.png]" .. "list[current_name;src;2,1;1,1;]" .. "list[current_name;dst;5,1;2,2;]" .. @@ -16,7 +18,7 @@ local machine_formspec = "" .. core.register_node( "stripped_tree:chiseling_machine", { - description = "Chiseladora para troncos", + description = S("Chiseling Machine"), tiles = { "chiseling_machine.png", "chiseling_machine.png", diff --git a/functions.lua b/functions.lua index 0d4141e..48b9675 100644 --- a/functions.lua +++ b/functions.lua @@ -1,3 +1,5 @@ +local S = core.get_translator(core.get_current_modname()) + stripped_tree = {} -- Select between chisel tool or axes. @@ -43,7 +45,7 @@ function stripped_tree.register_trunk(mod_name, trunk_names) for _, name in ipairs(trunk_names) do core.register_node( ":" .. mod_name .. ":stripped_" .. name, { - description = "Stripped " .. name, + description = S("Stripped @1", name), tiles = { "stripped_" .. mod_name .. "_" .. name .. "_top.png", "stripped_" .. mod_name .. "_" .. name .. "_top.png", diff --git a/init.lua b/init.lua index d3d3230..3a65769 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,8 @@ -- Get our own path local mpath = core.get_modpath("stripped_tree") +local S = core.get_translator(core.get_current_modname()) + -- Load functions dofile(mpath .. "/functions.lua") @@ -18,7 +20,7 @@ if core.get_modpath("moreores") then dofile(mpath .. "/moreores.lua") end if stripped_tree.ENABLE_CHISEL then core.register_tool( "stripped_tree:chisel", { - description = "Chisel for tree trunks", + description = S("Chisel for tree trunks"), inventory_image = "chisel.png", wield_image = "chisel.png", sound = {breaks = "default_tool_breaks"}, diff --git a/locale/stripped_tree.es.tr b/locale/stripped_tree.es.tr new file mode 100644 index 0000000..00239e5 --- /dev/null +++ b/locale/stripped_tree.es.tr @@ -0,0 +1,5 @@ +# textdomain: stripped_tree +Chiseling Machine=Cinceladora para troncos +Stripped @1=@1 cincelado +Tree bark=Corteza de árbol +Chisel for tree trunks=Cincel de tronco diff --git a/locale/stripped_tree.hu.tr b/locale/stripped_tree.hu.tr new file mode 100644 index 0000000..87d9c09 --- /dev/null +++ b/locale/stripped_tree.hu.tr @@ -0,0 +1,5 @@ +# textdomain: stripped_tree +Chiseling Machine=Kéregvéső Gép +Stripped @1=Kérgezett @1 +Tree bark=Fakéreg +Chisel for tree trunks=Kéregvéső diff --git a/locale/template.txt b/locale/template.txt new file mode 100644 index 0000000..54d99e5 --- /dev/null +++ b/locale/template.txt @@ -0,0 +1,5 @@ +# textdomain: stripped_tree +Chiseling Machine= +Stripped @1= +Tree bark= +Chisel for tree trunks= -- 2.49.1