share/hedgewars/Data/Scripts/Locale.lua
author Henek
Tue, 25 Jan 2011 20:32:58 +0100
changeset 4873 98dbb9b985e5
parent 4854 881c8232b66a
child 5616 a96231121eac
permissions -rw-r--r--
add a new lua library with misc tools and removed redundant tracker functions

-- Library for localizing strings in lua scripts

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