share/hedgewars/Data/Scripts/Locale.lua
author koda
Tue, 01 Feb 2011 15:30:08 +0100
changeset 4900 8ad0e23e6d63
parent 4854 881c8232b66a
child 5616 a96231121eac
permissions -rw-r--r--
addfilelog <3 debugfile

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