Add support for translations via intllib

This commit is contained in:
ShadowNinja
2013-10-30 13:45:32 -04:00
parent d8e02eb2dd
commit be2f30a1a2
35 changed files with 541 additions and 308 deletions

View File

@ -8,6 +8,13 @@ local load_start = os.clock()
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 @@ function hacky_swap_node(pos, name)
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