Replace deprecated function 'intllib.Getter':

- Check first for 'intllib.make_gettext_pair', otherwise continue using
function 'intllib.Getter'.
This commit is contained in:
AntumDeluge 2017-07-09 02:59:00 -07:00 committed by stujones11
parent 38d79b91a1
commit cc26d04345
7 changed files with 49 additions and 7 deletions

@ -1,7 +1,13 @@
local S = function(s) return s end local S = function(s) return s end
if minetest.global_exists("intllib") then if minetest.global_exists("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
S = intllib.make_gettext_pair()
else
-- Old method using text files.
S = intllib.Getter() S = intllib.Getter()
end end
end
armor:register_armor("3d_armor:helmet_admin", { armor:register_armor("3d_armor:helmet_admin", {
description = S("Admin Helmet"), description = S("Admin Helmet"),

@ -1,7 +1,13 @@
local S = function(s) return s end local S = function(s) return s end
if minetest.global_exists("intllib") then if minetest.global_exists("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
S = intllib.make_gettext_pair()
else
-- Old method using text files.
S = intllib.Getter() S = intllib.Getter()
end end
end
local modname = minetest.get_current_modname() local modname = minetest.get_current_modname()
local modpath = minetest.get_modpath(modname) local modpath = minetest.get_modpath(modname)
local worldpath = minetest.get_worldpath() local worldpath = minetest.get_worldpath()

@ -1,7 +1,13 @@
local S = function(s) return s end local S = function(s) return s end
if minetest.global_exists("intllib") then if minetest.global_exists("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
S = intllib.make_gettext_pair()
else
-- Old method using text files.
S = intllib.Getter() S = intllib.Getter()
end end
end
local armor_stand_formspec = "size[8,7]" .. local armor_stand_formspec = "size[8,7]" ..
default.gui_bg .. default.gui_bg ..
default.gui_bg_img .. default.gui_bg_img ..

@ -4,8 +4,14 @@ if not minetest.global_exists("unified_inventory") then
end end
local S = function(s) return s end local S = function(s) return s end
if minetest.global_exists("intllib") then if minetest.global_exists("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
S = intllib.make_gettext_pair()
else
-- Old method using text files.
S = intllib.Getter() S = intllib.Getter()
end end
end
if unified_inventory.sfinv_compat_layer then if unified_inventory.sfinv_compat_layer then
return return

@ -4,8 +4,14 @@ if not minetest.get_modpath("technic") then
end end
local S = function(s) return s end local S = function(s) return s end
if minetest.global_exists("intllib") then if minetest.global_exists("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
S = intllib.make_gettext_pair()
else
-- Old method using text files.
S = intllib.Getter() S = intllib.Getter()
end end
end
minetest.register_craftitem("hazmat_suit:helmet_hazmat", { minetest.register_craftitem("hazmat_suit:helmet_hazmat", {
description = S("Hazmat Helmet"), description = S("Hazmat Helmet"),

@ -1,7 +1,13 @@
local S = function(s) return s end local S = function(s) return s end
if minetest.global_exists("intllib") then if minetest.global_exists("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
S = intllib.make_gettext_pair()
else
-- Old method using text files.
S = intllib.Getter() S = intllib.Getter()
end end
end
local use_moreores = minetest.get_modpath("moreores") local use_moreores = minetest.get_modpath("moreores")
local function play_sound_effect(player, name) local function play_sound_effect(player, name)
if player then if player then

@ -4,8 +4,14 @@ if not minetest.get_modpath("technic_worldgen") then
end end
local S = function(s) return s end local S = function(s) return s end
if minetest.global_exists("intllib") then if minetest.global_exists("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
S = intllib.make_gettext_pair()
else
-- Old method using text files.
S = intllib.Getter() S = intllib.Getter()
end end
end
local stats = { local stats = {
lead = { name=S("Lead"), material="technic:lead_ingot", armor=1.6, heal=0, use=500, radiation=80*1.1 }, lead = { name=S("Lead"), material="technic:lead_ingot", armor=1.6, heal=0, use=500, radiation=80*1.1 },