diff --git a/3d.lua b/3d.lua index 3c7ab9a..f7296f2 100644 --- a/3d.lua +++ b/3d.lua @@ -1,4 +1,8 @@ +-- translation support +local S = minetest.get_translator("real_torch") + + local function on_flood(pos, oldnode, newnode) -- drop as unlit torch @@ -25,7 +29,7 @@ end -- unlit floor torch minetest.register_node("real_torch:torch", { - description = "Torch", + description = S("Unlit Torch"), drawtype = "mesh", mesh = "torch_floor.obj", inventory_image = "real_torch_on_floor.png", diff --git a/init.lua b/init.lua index ae42608..a91b52a 100644 --- a/init.lua +++ b/init.lua @@ -7,15 +7,18 @@ real_torch = {} real_torch.min_duration = tonumber(minetest.settings:get("torch_min_duration")) or 1200 real_torch.max_duration = tonumber(minetest.settings:get("torch_max_duration")) or 1800 +-- translation support +local S = minetest.get_translator("real_torch") -- add unlit torches - dofile(minetest.get_modpath("real_torch") .. "/3d.lua") +dofile(minetest.get_modpath("real_torch") .. "/3d.lua") -- start timer on any already placed torches minetest.register_lbm({ name = "real_torch:convert_torch_to_node_timer", nodenames = {"default:torch", "default:torch_wall", "default:torch_ceiling"}, + action = function(pos) if not minetest.get_node_timer(pos):is_started() then @@ -29,15 +32,14 @@ minetest.register_lbm({ -- creative check local creative_mode_cache = minetest.settings:get_bool("creative_mode") - -function is_creative(name) +local function is_creative(name) return creative_mode_cache or minetest.check_player_privs(name, {creative = true}) end -- coal powder minetest.register_craftitem("real_torch:coal_powder", { - description = "Coal Powder", + description = S("Coal Powder"), inventory_image = "real_torch_coal_powder.png", -- punching unlit torch with coal powder relights