share/hedgewars/Data/Scripts/Locale.lua
author koda
Wed, 23 Mar 2011 16:27:24 +0100
changeset 5043 2df62e1a6c02
parent 4854 881c8232b66a
child 5616 a96231121eac
permissions -rw-r--r--
glswapbuffer consistency and create the window in the center (still, it doesn't work past sdl r5296)

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