share/hedgewars/Data/Scripts/Locale.lua
author Henek
Tue, 18 Jan 2011 22:55:58 +0100
changeset 4854 881c8232b66a
parent 4502 759c1a3bb156
child 5616 a96231121eac
permissions -rw-r--r--
adding my new Tracker library so mikade can use it with you guys on dev, still might change a bit though

-- 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