From be2f30a1a2f5b6c2aae7fd4cf8231aec2da0844d Mon Sep 17 00:00:00 2001
From: ShadowNinja <noreply@gmail.com>
Date: Wed, 30 Oct 2013 18:48:39 +0100
Subject: [PATCH] Add support for translations via intllib

---
 technic/machines/MV/tool_workshop.lua |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/technic/machines/MV/tool_workshop.lua b/technic/machines/MV/tool_workshop.lua
index 7d8bdf3..046fef1 100644
--- a/technic/machines/MV/tool_workshop.lua
+++ b/technic/machines/MV/tool_workshop.lua
@@ -1,7 +1,10 @@
--- LV Tool workshop
+-- Tool workshop
 -- This machine repairs tools.
 
 minetest.register_alias("tool_workshop", "technic:tool_workshop")
+
+local S = technic.getter
+
 minetest.register_craft({
 	output = 'technic:tool_workshop',
 	recipe = {
@@ -14,19 +17,18 @@
 local workshop_formspec =
 	"invsize[8,9;]"..
 	"list[current_name;src;3,1;1,1;]"..
-	"label[0,0;Tool Workshop]"..
+	"label[0,0;"..S("Tool Workshop").."]"..
 	"list[current_player;main;0,5;8,4;]"
 
 minetest.register_node("technic:tool_workshop", {
-	description = "Tool Workshop",
+	description = S("Tool Workshop"),
 	tiles = {"technic_workshop_top.png", "technic_machine_bottom.png", "technic_workshop_side.png",
 	         "technic_workshop_side.png", "technic_workshop_side.png", "technic_workshop_side.png"},
 	groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
 	sounds = default.node_sound_wood_defaults(),
 	on_construct = function(pos)
 		local meta = minetest.get_meta(pos)
-		meta:set_string("infotext", "Tool Workshop")
-		meta:set_float("technic_power_machine", 1)
+		meta:set_string("infotext", S("Tool Workshop"))
 		meta:set_string("formspec", workshop_formspec)
 		local inv = meta:get_inventory()
 		inv:set_size("src", 1)
@@ -36,7 +38,7 @@
 		local inv = meta:get_inventory()
 		if not inv:is_empty("src") then
 			minetest.chat_send_player(player:get_player_name(),
-				"Machine cannot be removed because it is not empty");
+				S("Machine cannot be removed because it is not empty"))
 			return false
 		end
 		return true
@@ -51,7 +53,7 @@
 		local meta         = minetest.get_meta(pos)
 		local inv          = meta:get_inventory()
 		local eu_input     = meta:get_int("MV_EU_input")
-		local machine_name = "Tool Workshop"
+		local machine_name = S("Tool Workshop")
 		local machine_node = "technic:tool_workshop"
 		local demand       = 5000
 
@@ -70,15 +72,15 @@
 		   srcstack:get_wear() == 0 or
 		   srcstack:get_name() == "technic:water_can" or
 		   srcstack:get_name() == "technic:lava_can" then
-			meta:set_string("infotext", machine_name.." Idle")
+			meta:set_string("infotext", S("%s Idle"):format(machine_name))
 			meta:set_int("MV_EU_demand", 0)
 			return
 		end
 		
 		if eu_input < demand then
-			meta:set_string("infotext", machine_name.." Unpowered")
+			meta:set_string("infotext", S("%s Unpowered"):format(machine_name))
 		elseif eu_input >= demand then
-			meta:set_string("infotext", machine_name.." Active")
+			meta:set_string("infotext", S("%s Active"):format(machine_name))
 			srcstack:add_wear(-1000)
 			inv:set_stack("src", 1, srcstack)
 		end

--
Gitblit v1.8.0