Fix error of backguard compatibility for 0.4 due usage of core translator
* use compatibility code for intllib lib in 0.4 series * added dependency around intllib for 0.4 * closes: https://codeberg.org/minenux/mobs_balrog/issues/2
This commit is contained in:
parent
e8f5a7062d
commit
45d63343a6
2
depends.txt
Normal file
2
depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
mobs
|
||||
intllib?
|
16
init.lua
16
init.lua
@ -41,8 +41,20 @@
|
||||
|
||||
-- Used for localization
|
||||
|
||||
local S = minetest.get_translator("mobs_balrog")
|
||||
|
||||
local S, NS
|
||||
if minetest.get_translator ~= nil then
|
||||
S = minetest.get_translator(core.get_current_modname())
|
||||
else
|
||||
if minetest.get_modpath("intllib") then
|
||||
local MP = minetest.get_modpath("intllib")
|
||||
S, NS = dofile(MP.."/lib/intllib.lua")
|
||||
else
|
||||
S = function(str, ...)
|
||||
local args={...}
|
||||
return str:gsub("@%d+", function(match) return args[tonumber(match:sub(2))] end )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--
|
||||
-- Balrog's spawn settings
|
||||
|
Loading…
x
Reference in New Issue
Block a user