share/hedgewars/Data/Scripts/Locale.lua
author unc0rr
Mon, 10 Jan 2011 18:20:58 +0300
changeset 4831 57b46b5dbfff
parent 4502 759c1a3bb156
child 4854 881c8232b66a
permissions -rw-r--r--
Prevent frontend crash in certain circumstances

local lang = loadfile(GetDataPath() .. "Locale/" .. tostring(L) .. ".lua")
if lang ~= nil then
    lang()
end

function loc(text)
    if lang ~= nil and locale ~= nil and locale[text] ~= nil then return locale[text]
    else return text
    end
end