share/hedgewars/Data/Scripts/Locale.lua
author Wuzzy <Wuzzy@disroot.org>
Mon, 19 Jun 2023 14:09:37 +0200
changeset 15990 79b1129b4d03
parent 13728 247d1bcf3c5e
permissions -rw-r--r--
Fix game freezing if Format arg contains '%1', '%2', etc. (bug #851)

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