update translation detection

This commit is contained in:
tenplus1 2020-08-25 09:57:09 +01:00
parent 07d04cc9ca
commit 74fdca46d9
3 changed files with 10 additions and 24 deletions

View File

@ -1,4 +1,4 @@
default
mobs
intllib?
lucky_block?
intllib?

View File

@ -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"))

3
intllib.lua Normal file
View File

@ -0,0 +1,3 @@
-- Support for the old multi-load method
dofile(minetest.get_modpath("intllib").."/init.lua")