From 09eaddbba6b2b7f558d0f62d211ac38ae230d8d6 Mon Sep 17 00:00:00 2001 From: AntumDeluge Date: Sat, 8 Jul 2017 22:18:25 -0700 Subject: [PATCH 1/2] Call 'global_exists' in place of 'get_modpath' for 'intllib' check --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index aee2a60..5763826 100644 --- a/init.lua +++ b/init.lua @@ -6,7 +6,7 @@ ilights = {} -- Boilerplate to support localized strings if intllib mod is installed. local S -if minetest.get_modpath("intllib") then +if minetest.global_exists("intllib") then S = intllib.Getter() else S = function(s) return s end From d7f4f7e27083247c5f387fa707bd181b34623fbb Mon Sep 17 00:00:00 2001 From: AntumDeluge Date: Sat, 8 Jul 2017 22:20:18 -0700 Subject: [PATCH 2/2] Replace deprecated function 'intllib.Getter': - Check first for 'intllib.make_gettext_pair', otherwise continue using old function. --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 5763826..ed6f6e5 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,13 @@ ilights = {} -- Boilerplate to support localized strings if intllib mod is installed. local S if minetest.global_exists("intllib") then - S = intllib.Getter() + if intllib.make_gettext_pair then + -- New method using gettext. + S = intllib.make_gettext_pair() + else + -- Old method using text files. + S = intllib.Getter() + end else S = function(s) return s end end