summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2015-02-16 23:57:22 -0500
committerShadowNinja <shadowninja@minetest.net>2015-02-16 23:57:22 -0500
commit475711f7f78f2a798aa1e456e04d190a6c2e60d2 (patch)
treee1130b87fad494230a85c91eb8b8c0e81947ecc7
parent2ef1abad55f0e1b8b76169cdb1da3bc3f8749c67 (diff)
Switch to slightly cleaner compatibility method
-rw-r--r--init.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/init.lua b/init.lua
index 3a0264c..21d4e02 100644
--- a/init.lua
+++ b/init.lua
@@ -1,5 +1,12 @@
--- Support the old multi-load method
-intllib = rawget(_G, "intllib") or {}
+
+-- Old multi-load method compatibility
+if rawget(_G, "intllib") then return end
+
+intllib = {
+ getters = {},
+ strings = {},
+}
+
local MP = minetest.get_modpath("intllib")
@@ -11,11 +18,6 @@ if not (LANG and (LANG ~= "")) then LANG = os.getenv("LANG") end
if not (LANG and (LANG ~= "")) then LANG = "en" end
LANG = LANG:sub(1, 2)
--- Support the old multi-load method
-intllib.getters = intllib.getters or {}
-
-intllib.strings = {}
-
local INS_CHAR = intllib.INSERTION_CHAR
local insertion_pattern = "("..INS_CHAR.."?)"..INS_CHAR.."(%(?)(%d+)(%)?)"