share/hedgewars/Data/Scripts/Locale.lua
author unc0rr
Tue, 14 Jan 2014 12:44:29 +0400
changeset 9985 42cd42e44c9a
parent 8824 fe9eacd390f2
child 12013 3e615852f36e
permissions -rw-r--r--
GravRacer, GravHigh, GravMutant, Grav... uhm... shoppamap? Easy! Gravity script could be combined with any other script now. TODO: security concerns? script name to load is passed via game scheme.

-- Library for localizing strings in lua scripts

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

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