backguard compatibility for translation checks
* this made compatible the mod with MT 0.4 and MT 5.X
This commit is contained in:
parent
656f82f1cb
commit
999c1d0d8f
23
init.lua
23
init.lua
@ -21,7 +21,28 @@
|
|||||||
|
|
||||||
|
|
||||||
-- Load support for MT game translation.
|
-- Load support for MT game translation.
|
||||||
local S = core.get_translator(core.get_current_modname())
|
-- Check for translation method
|
||||||
|
local S
|
||||||
|
if minetest.get_translator ~= nil then
|
||||||
|
S = minetest.get_translator(core.get_current_modname()) -- 5.x translation function
|
||||||
|
else
|
||||||
|
if minetest.get_modpath("intllib") then
|
||||||
|
dofile(minetest.get_modpath("intllib") .. "/init.lua")
|
||||||
|
if intllib.make_gettext_pair then
|
||||||
|
gettext, ngettext = intllib.make_gettext_pair() -- new gettext method
|
||||||
|
else
|
||||||
|
gettext = intllib.Getter() -- old text file method
|
||||||
|
end
|
||||||
|
S = gettext
|
||||||
|
else -- boilerplate function
|
||||||
|
S = function(str, ...)
|
||||||
|
local args = {...}
|
||||||
|
return str:gsub("@%d+", function(match)
|
||||||
|
return args[tonumber(match:sub(2))]
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local kill_hitter = core.settings:get_bool("pvpinvul_kill_hitter")
|
local kill_hitter = core.settings:get_bool("pvpinvul_kill_hitter")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user