From 62bc13078f4e93993ebf121cc9c74bc31a6e5d90 Mon Sep 17 00:00:00 2001 From: Louis Royer <4259825-lroyer@users.noreply.gitlab.com> Date: Tue, 18 Feb 2020 17:34:52 +0000 Subject: Add translation support - Created `locale/template.txt` - Fixed some typos - Replace some `print("[pipeworks]"..` with `pipeworks.logger()` - Removed "You hacker, you" from descriptions --- routing_tubes.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'routing_tubes.lua') diff --git a/routing_tubes.lua b/routing_tubes.lua index 3a69c0a..1ebcf06 100644 --- a/routing_tubes.lua +++ b/routing_tubes.lua @@ -1,6 +1,6 @@ - +local S = minetest.get_translator("pipeworks") -- the default tube and default textures -pipeworks.register_tube("pipeworks:tube", "Pneumatic tube segment") +pipeworks.register_tube("pipeworks:tube", S("Pneumatic tube segment")) minetest.register_craft( { output = "pipeworks:tube_1 6", recipe = { @@ -13,7 +13,7 @@ minetest.register_craft( { local nodecolor = 0xffff3030 pipeworks.register_tube("pipeworks:broken_tube", { - description = "Broken Tube (you hacker you)", + description = S("Broken Tube"), plain = { { name = "pipeworks_broken_tube_plain.png", backface_culling = false, color = nodecolor } }, noctr = { { name = "pipeworks_broken_tube_plain.png", backface_culling = false, color = nodecolor } }, ends = { { name = "pipeworks_broken_tube_end.png", color = nodecolor } }, @@ -35,7 +35,7 @@ pipeworks.register_tube("pipeworks:broken_tube", { local itemstack = puncher:get_wielded_item() local wieldname = itemstack:get_name() local playername = puncher:get_player_name() - print("[Pipeworks] "..playername.." struck a broken tube at "..minetest.pos_to_string(pos)) + local log_msg = playername.." struck a broken tube at "..minetest.pos_to_string(pos).."\n" if wieldname == "anvil:hammer" or wieldname == "cottages:hammer" or wieldname == "glooptest:hammer_steel" @@ -47,17 +47,17 @@ pipeworks.register_tube("pipeworks:broken_tube", { local meta = minetest.get_meta(pos) local was_node = minetest.deserialize(meta:get_string("the_tube_was")) if was_node and was_node ~= "" then - print(" with "..wieldname.." to repair it.") + pipeworks.logger(log_msg.." with "..wieldname.." to repair it.") minetest.swap_node(pos, { name = was_node.name, param2 = was_node.param2 }) pipeworks.scan_for_tube_objects(pos) itemstack:add_wear(1000) puncher:set_wielded_item(itemstack) return itemstack else - print(" but it can't be repaired.") + pipeworks.logger(log_msg.." but it can't be repaired.") end else - print(" with "..wieldname.." but that tool is too weak.") + pipeworks.logger(log_msg.." with "..wieldname.." but that tool is too weak.") end end } @@ -69,7 +69,7 @@ pipeworks.register_tube("pipeworks:broken_tube", { if pipeworks.enable_priority_tube then local color = "#ff3030:128" pipeworks.register_tube("pipeworks:priority_tube", { - description = "High Priority Tube Segment", + description = S("High Priority Tube Segment"), inventory_image = "pipeworks_tube_inv.png^[colorize:" .. color, plain = { { name = "pipeworks_tube_plain.png", color = nodecolor } }, noctr = { { name = "pipeworks_tube_noctr.png", color = nodecolor } }, @@ -91,7 +91,7 @@ end if pipeworks.enable_accelerator_tube then pipeworks.register_tube("pipeworks:accelerator_tube", { - description = "Accelerating Pneumatic Tube Segment", + description = S("Accelerating Pneumatic Tube Segment"), inventory_image = "pipeworks_accelerator_tube_inv.png", plain = { "pipeworks_accelerator_tube_plain.png" }, noctr = { "pipeworks_accelerator_tube_noctr.png" }, @@ -116,7 +116,7 @@ end if pipeworks.enable_crossing_tube then pipeworks.register_tube("pipeworks:crossing_tube", { - description = "Crossing Pneumatic Tube Segment", + description = S("Crossing Pneumatic Tube Segment"), inventory_image = "pipeworks_crossing_tube_inv.png", plain = { "pipeworks_crossing_tube_plain.png" }, noctr = { "pipeworks_crossing_tube_noctr.png" }, @@ -138,7 +138,7 @@ end if pipeworks.enable_one_way_tube then minetest.register_node("pipeworks:one_way_tube", { - description = "One way tube", + description = S("One way tube"), tiles = {"pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_top.png", "pipeworks_one_way_tube_output.png", "pipeworks_one_way_tube_input.png", "pipeworks_one_way_tube_side.png", "pipeworks_one_way_tube_top.png"}, paramtype2 = "facedir", -- cgit v1.2.3