share/hedgewars/Data/Scripts/Locale.lua
changeset 13723 ade61b4eb63f
parent 13088 2b5314cc356c
child 13726 247d1bcf3c5e
equal deleted inserted replaced
13722:6cdb12449be7 13723:ade61b4eb63f
     1 -- Library for localizing strings in lua scripts
     1 -- Library for localizing strings in lua scripts
     2 
     2 
     3 local lang = HedgewarsScriptLoad("Locale/" .. tostring(LOCALE) .. ".lua")
     3 if LOCALE ~= "en" then
       
     4     HedgewarsScriptLoad("Locale/" .. tostring(LOCALE) .. ".lua")
       
     5 end
     4 
     6 
     5 function loc(text)
     7 function loc(text)
     6     if locale ~= nil and locale[text] ~= nil then return locale[text]
     8     if locale ~= nil and locale[text] ~= nil then return locale[text]
     7     else return text
     9     else return text
     8     end
    10     end