Skip to content

Commit

Permalink
Replace deprecated 'intllib' function:
Browse files Browse the repository at this point in the history
- 'intllib.Getter' with 'intllib'make_gettext_pair' if available,
otherwise use deprecated function.
  • Loading branch information
AntumDeluge committed Jul 9, 2017
1 parent a84b5f3 commit 72cc0cf
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion concrete/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local technic = rawget(_G, "technic") or {}
technic.concrete_posts = {}

-- Boilerplate to support localized strings if intllib mod is installed.
local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
local S = rawget(_G, "intllib") and (intllib.make_gettext_pair() or intllib.Getter()) or function(s) return s end

for i = 0, 31 do
minetest.register_alias("technic:concrete_post"..i,
Expand Down
2 changes: 1 addition & 1 deletion extranodes/init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Minetest 0.4.6 mod: extranodes
-- namespace: technic
-- Boilerplate to support localized strings if intllib mod is installed.
local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
local S = rawget(_G, "intllib") and (intllib.make_gettext_pair() or intllib.Getter()) or function(s) return s end

if minetest.get_modpath("moreblocks") then

Expand Down
6 changes: 5 additions & 1 deletion technic/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ technic.modpath = modpath

-- Boilerplate to support intllib
if rawget(_G, "intllib") then
technic.getter = intllib.Getter()
if intllib.make_gettext_pair then
technic.getter = intllib.make_gettext_pair()
else
technic.getter = intllib.Getter()
end
else
technic.getter = 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
Expand Down
6 changes: 5 additions & 1 deletion technic/machines/MV/lighting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
local S
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
if (intllib.make_gettext_pair) then
S = intllib.make_gettext_pair(minetest.get_current_modname())
else
S = intllib.Getter(minetest.get_current_modname())
end
else
S = function (s) return s end
end
Expand Down
2 changes: 1 addition & 1 deletion technic_chests/register.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
local S = rawget(_G, "intllib") and (intllib.make_gettext_pair() or intllib.Getter()) or function(s) return s end

local pipeworks = rawget(_G, "pipeworks")
local fs_helpers = rawget(_G, "fs_helpers")
Expand Down
2 changes: 1 addition & 1 deletion technic_worldgen/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local modpath = minetest.get_modpath("technic_worldgen")

technic = rawget(_G, "technic") or {}
technic.worldgen = {
gettext = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end,
gettext = rawget(_G, "intllib") and (intllib.make_gettext_pair() or intllib.Getter()) or function(s) return s end,
}

dofile(modpath.."/config.lua")
Expand Down
2 changes: 1 addition & 1 deletion wrench/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dofile(modpath.."/support.lua")
dofile(modpath.."/technic.lua")

-- Boilerplate to support localized strings if intllib mod is installed.
local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end
local S = rawget(_G, "intllib") and (intllib.make_gettext_pair() or intllib.Getter()) or function(s) return s end

local function get_meta_type(name, metaname)
local def = wrench.registered_nodes[name]
Expand Down

0 comments on commit 72cc0cf

Please sign in to comment.