mirror of
https://github.com/minetest-mods/technic.git
synced 2025-07-01 07:40:37 +02:00
Add support for translations via intllib
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user