From 72cc0cf3f7f98d0c7580c6709d0d3cf91c657661 Mon Sep 17 00:00:00 2001 From: AntumDeluge Date: Sat, 8 Jul 2017 14:01:33 -0700 Subject: [PATCH] Replace deprecated 'intllib' function: - 'intllib.Getter' with 'intllib'make_gettext_pair' if available, otherwise use deprecated function. --- concrete/init.lua | 2 +- extranodes/init.lua | 2 +- technic/init.lua | 6 +++++- technic/machines/MV/lighting.lua | 6 +++++- technic_chests/register.lua | 2 +- technic_worldgen/init.lua | 2 +- wrench/init.lua | 2 +- 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/concrete/init.lua b/concrete/init.lua index ca047338d..dbb0d729b 100644 --- a/concrete/init.lua +++ b/concrete/init.lua @@ -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, diff --git a/extranodes/init.lua b/extranodes/init.lua index eb54067a8..93bb102d6 100644 --- a/extranodes/init.lua +++ b/extranodes/init.lua @@ -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 diff --git a/technic/init.lua b/technic/init.lua index 0d97319e1..0763e14ef 100644 --- a/technic/init.lua +++ b/technic/init.lua @@ -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 diff --git a/technic/machines/MV/lighting.lua b/technic/machines/MV/lighting.lua index 76fcb20e2..e8406916e 100644 --- a/technic/machines/MV/lighting.lua +++ b/technic/machines/MV/lighting.lua @@ -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 diff --git a/technic_chests/register.lua b/technic_chests/register.lua index 0d5c7679e..1c68c978f 100644 --- a/technic_chests/register.lua +++ b/technic_chests/register.lua @@ -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") diff --git a/technic_worldgen/init.lua b/technic_worldgen/init.lua index 2f369200f..8f3d1d114 100644 --- a/technic_worldgen/init.lua +++ b/technic_worldgen/init.lua @@ -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") diff --git a/wrench/init.lua b/wrench/init.lua index bae77aab2..ca2790004 100644 --- a/wrench/init.lua +++ b/wrench/init.lua @@ -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]