diff options
author | ShadowNinja <shadowninja@minetest.net> | 2015-02-16 23:57:22 -0500 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2015-02-16 23:57:22 -0500 |
commit | 475711f7f78f2a798aa1e456e04d190a6c2e60d2 (patch) | |
tree | e1130b87fad494230a85c91eb8b8c0e81947ecc7 | |
parent | 2ef1abad55f0e1b8b76169cdb1da3bc3f8749c67 (diff) |
Switch to slightly cleaner compatibility method
-rw-r--r-- | init.lua | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -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+)(%)?)" |