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/init.lua |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/technic/init.lua b/technic/init.lua
index 8c4fa09..71a7f45 100644
--- a/technic/init.lua
+++ b/technic/init.lua
@@ -8,6 +8,13 @@
 local modpath = minetest.get_modpath("technic")
 technic.modpath = modpath
 
+-- Boilerplate to support intllib + S("%s", "foo") syntax
+if intllib then
+	technic.getter = intllib.Getter()
+else
+	technic.getter = function(s) return s end
+end
+local S = technic.getter
 
 -- Read configuration file
 dofile(modpath.."/config.lua")
@@ -55,6 +62,6 @@
 end
 
 if minetest.setting_get("log_mod") then
-	print("[Technic] Loaded in "..tostring(os.clock() - load_start).."s")
+	print(S("[Technic] Loaded in %f seconds"):format(os.clock() - load_start))
 end
 

--
Gitblit v1.8.0