share/hedgewars/Data/Scripts/Locale.lua
author Wuzzy <Wuzzy2@mail.ru>
Fri, 16 Mar 2018 02:02:27 +0100
changeset 13226 4028d7f85233
parent 13088 2b5314cc356c
child 13725 ade61b4eb63f
permissions -rw-r--r--
Make video metadata strings translatable in frontend In the video page, a small part of the strings was untranslatable, e.g. “Player: ”. These were part of the video metadata. Now these are localizable.

-- Library for localizing strings in lua scripts

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

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