share/hedgewars/Data/Scripts/Locale.lua
author Wuzzy <Wuzzy2@mail.ru>
Fri, 31 Aug 2018 21:34:33 +0200
changeset 13731 247d1bcf3c5e
parent 13728 ade61b4eb63f
permissions -rw-r--r--
Add 2nd optional parameter to HedgewarsScriptLoad. If false, its OK if file does not exist. Also, return true/false on success

-- Library for localizing strings in lua scripts

if LOCALE ~= "en" then
    HedgewarsScriptLoad("Locale/" .. tostring(LOCALE) .. ".lua", false)
end

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

function loc_noop(text)
    return text
end