adapt to work with older engines also
* backguard compatibility for translation functions
This commit is contained in:
parent
5fa4093bfb
commit
54f9ec26fd
@ -1,4 +1,4 @@
|
||||
local S = minetest.get_translator("marinara")
|
||||
local S = marinara.S
|
||||
|
||||
minetest.register_node("marinara:hardcoral_brown", {
|
||||
description = S("Brown Hard Coral"),
|
||||
|
@ -1,4 +1,4 @@
|
||||
local S = minetest.get_translator("marinara")
|
||||
local S = marinara.S
|
||||
|
||||
stairs.register_stair_and_slab(
|
||||
"marinara_reed_node",
|
||||
|
23
init.lua
23
init.lua
@ -18,6 +18,29 @@ if marinara.settings.clear_ores then
|
||||
minetest.clear_registered_ores()
|
||||
end
|
||||
|
||||
if minetest.get_translator ~= nil then
|
||||
S = minetest.get_translator("skins")
|
||||
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
|
||||
|
||||
marinara.S = S
|
||||
|
||||
local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
||||
|
||||
-- plants
|
||||
|
@ -1,4 +1,4 @@
|
||||
local S = minetest.get_translator("marinara")
|
||||
local S = marinara.S
|
||||
|
||||
minetest.register_node("marinara:reed_root", {
|
||||
description = S("Reed Root"),
|
||||
|
@ -1,4 +1,4 @@
|
||||
local S = minetest.get_translator("marinara")
|
||||
local S = marinara.S
|
||||
|
||||
-- soft corals
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user