1-- Library for localizing strings in lua scripts
2
3local lang = loadfile(GetUserDataPath() .. "Locale/" .. tostring(L) .. ".lua")
4
5if lang ~= nil then
6    lang()
7else
8    lang = loadfile(GetDataPath() .. "Locale/" .. tostring(L) .. ".lua")
9    if lang ~= nil then
10        lang()
11    end
12end
13
14function loc(text)
15    if lang ~= nil and locale ~= nil and locale[text] ~= nil then return locale[text]
16    else return text
17    end
18end
19