diff --git a/depends.txt b/depends.txt index 58b4e62..3168c5a 100644 --- a/depends.txt +++ b/depends.txt @@ -1,4 +1,4 @@ default mobs -intllib? lucky_block? +intllib? diff --git a/init.lua b/init.lua index 3145967..74c6fe5 100644 --- a/init.lua +++ b/init.lua @@ -1,33 +1,16 @@ -local path = minetest.get_modpath("mobs_npc") - --- Intllib -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s, a, ...) - if a == nil then - return s - end - a = {a, ...} - return s:gsub("(@?)@(%(?)(%d+)(%)?)", - function(e, o, n, c) - if e == ""then - return a[tonumber(n)] .. (o == "" and c or "") - else - return "@" .. o .. n .. c - end - end) - end -end +-- Load support for intllib. +local path = minetest.get_modpath(minetest.get_current_modname()) +local S = minetest.get_translator and minetest.get_translator("mobs_npc") or + dofile(path .. "/intllib.lua") mobs.intllib = S --- NPC +-- NPCs dofile(path .. "/npc.lua") -- TenPlus1 dofile(path .. "/trader.lua") dofile(path .. "/igor.lua") +-- Lucky Blocks dofile(path .. "/lucky_block.lua") print (S("[MOD] Mobs Redo NPCs loaded")) diff --git a/intllib.lua b/intllib.lua new file mode 100644 index 0000000..adb0f88 --- /dev/null +++ b/intllib.lua @@ -0,0 +1,3 @@ +-- Support for the old multi-load method +dofile(minetest.get_modpath("intllib").."/init.lua") +