share/hedgewars/Data/Scripts/Locale.lua
author sheepluva
Sat, 12 Sep 2015 20:01:26 +0200
branchgettext
changeset 11168 e104e060911b
parent 8824 fe9eacd390f2
permissions -rw-r--r--
experimental gettext for lua

-- Library for localizing strings in lua scripts

local lang = nil

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

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