update translation checks

This commit is contained in:
tenplus1 2022-01-20 08:56:28 +00:00
parent 23e24bff06
commit f792de52af
13 changed files with 36 additions and 21 deletions

View File

@ -1,5 +1,5 @@
local S = mobs.intllib
local S = mobs.intllib_monster
local dirt_types = {

View File

@ -1,5 +1,5 @@
local S = mobs.intllib
local S = mobs.intllib_monster
local master_types = {

View File

@ -1,5 +1,5 @@
local S = mobs.intllib
local S = mobs.intllib_monster
local mob_drops = {
{name = "fireflies:firefly", chance = 1, min = 1, max = 1}

View File

@ -2,10 +2,32 @@
-- Load support for intllib.
local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
local S = minetest.get_translator and minetest.get_translator("mobs_monster") or
dofile(path .. "intllib.lua")
local S
mobs.intllib = S
-- Check for translation method
local S
if minetest.get_translator ~= nil then
S = minetest.get_translator("mobs_monster") -- 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
mobs.intllib_monster = S
-- Check for custom mob spawn file

View File

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

View File

@ -1,5 +1,5 @@
local S = mobs.intllib
local S = mobs.intllib_monster
local guard_types = {

View File

@ -1,6 +1,5 @@
local S = mobs.intllib
local S = mobs.intllib_monster
-- Lava Flan by Zeg9 (additional textures by JurajVajda)

View File

@ -1,6 +1,5 @@
local S = mobs.intllib
local S = mobs.intllib_monster
-- Mese Monster by Zeg9

View File

@ -1,6 +1,5 @@
local S = mobs.intllib
local S = mobs.intllib_monster
-- Oerkki by PilzAdam

View File

@ -1,6 +1,5 @@
local S = mobs.intllib
local S = mobs.intllib_monster
-- custom particle effects
local effect = function(

View File

@ -1,5 +1,5 @@
local S = mobs.intllib
local S = mobs.intllib_monster
local get_velocity = function(self)

View File

@ -1,5 +1,5 @@
local S = mobs.intllib
local S = mobs.intllib_monster
local stone_types = {

View File

@ -1,5 +1,5 @@
local S = mobs.intllib
local S = mobs.intllib_monster
local tree_types = {