share/hedgewars/Data/Scripts/Locale.lua
branchgettext
changeset 11168 e104e060911b
parent 8824 fe9eacd390f2
equal deleted inserted replaced
11167:13d332e62860 11168:e104e060911b
     1 -- Library for localizing strings in lua scripts
     1 -- Library for localizing strings in lua scripts
     2 
     2 
     3 local lang = HedgewarsScriptLoad("Locale/" .. tostring(L) .. ".lua")
     3 local lang = nil
     4 
     4 
     5 function loc(text)
     5 function lua_loc(text)
     6     if locale ~= nil and locale[text] ~= nil then return locale[text]
     6     if locale ~= nil and locale[text] ~= nil then return locale[text]
     7     else return text
     7     else return text
     8     end
     8     end
     9 end
     9 end
       
    10 
       
    11 if loc == nil then
       
    12     lang = HedgewarsScriptLoad("Locale/" .. tostring(L) .. ".lua")
       
    13     loc = lua_loc
       
    14 end
       
    15