share/hedgewars/Data/Scripts/Locale.lua
author koda
Sat, 23 Mar 2013 18:43:24 +0100
branch0.9.19
changeset 8788 b6badc953945
parent 8349 a1dbe148f10f
child 8824 fe9eacd390f2
permissions -rw-r--r--
lupdate

-- Library for localizing strings in lua scripts

local lang = HedgewarsScriptLoad("Locale/" .. tostring(L) .. ".lua")

if lang ~= nil then
    lang()
else
    lang = HedgewarsScriptLoad("Locale/" .. tostring(L) .. ".lua")
    if lang ~= nil then
        lang()
    end
end

function loc(text)
    if lang ~= nil and locale ~= nil and locale[text] ~= nil then return locale[text]
    else return text
    end
end