fix translation support
This commit is contained in:
parent
cdfa83c6dc
commit
35fcd870cf
27
init.lua
27
init.lua
@ -4,9 +4,30 @@
|
|||||||
-- the default sfinv or inventory_plus when running.
|
-- the default sfinv or inventory_plus when running.
|
||||||
-- Released by TenPlus1 and based on Zeg9's code under MIT license
|
-- Released by TenPlus1 and based on Zeg9's code under MIT license
|
||||||
|
|
||||||
-- Load support for intllib.
|
-- Load support for translation.
|
||||||
local S = minetest.get_translator and minetest.get_translator("simple_skins") or
|
local S
|
||||||
dofile(skins.modpath .. "/intllib.lua")
|
|
||||||
|
if minetest.get_translator ~= nil then
|
||||||
|
S = minetest.get_translator("simple_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
|
||||||
|
|
||||||
|
|
||||||
skins = {
|
skins = {
|
||||||
skins = {}, list = {}, meta = {}, formspec = {},
|
skins = {}, list = {}, meta = {}, formspec = {},
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
-- Support for the old multi-load method
|
|
||||||
dofile(minetest.get_modpath("intllib").."/init.lua")
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user