share/hedgewars/Data/Scripts/Locale.lua
author Henek
Fri, 10 Dec 2010 23:58:15 +0100
changeset 4502 759c1a3bb156
child 4854 881c8232b66a
permissions -rw-r--r--
lua access to data dir by GetDataPath and made a new scripting translation system with Locale.lua as library and .lua files under Locale. Updated maps Basketball and Knockball to this new system.

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