Switch to slightly cleaner compatibility method

This commit is contained in:
ShadowNinja 2015-02-16 23:57:22 -05:00
parent 2ef1abad55
commit 475711f7f7
1 changed files with 9 additions and 7 deletions

View File

@ -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+)(%)?)"