share/hedgewars/Data/Scripts/Locale.lua
author belphegorr <szabibibi@gmail.com>
Fri, 10 Aug 2012 04:26:58 +0300
changeset 7448 d0521a3a4358
parent 5616 a96231121eac
child 8349 a1dbe148f10f
permissions -rw-r--r--
Solved "floating repositionings" in every mission Fixed bug where gear message wouldn't be reset after animations Mission 5: fixed bug where control would be messed up when animation interrupted the turn of a hedgehog that was using multi-shot weapons Replaced graves with circles for marking enemy positions

-- Library for localizing strings in lua scripts

local lang = loadfile(GetUserDataPath() .. "Locale/" .. tostring(L) .. ".lua")

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

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