Make strings translatable #4

Merged
gergely merged 2 commits from translatable into main 2025-12-17 12:54:15 +01:00
7 changed files with 27 additions and 4 deletions

View File

@@ -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",

View File

@@ -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",

View File

@@ -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"},

View File

@@ -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

View File

@@ -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ő

5
locale/template.txt Normal file
View File

@@ -0,0 +1,5 @@
# textdomain: stripped_tree
Chiseling Machine=
Stripped @1=
Tree bark=
Chisel for tree trunks=

View File

@@ -1,4 +1,6 @@
name = stripped_tree
title = Stripped Trees
description = Adds stripped tree trunks
author = 1faco
depends = default
optional_depends = moretrees, ethereal, moreores