[init] handle the case in which translate() gets called with no dictionary.

master
Lorenzo Cogotti 2 years ago
parent cc9d45cb44
commit a3488431b2

@ -90,8 +90,9 @@ end
--
-- @return localized and formatted string.
function moonspeak.translate(id, ...)
local msg = rawget(moonspeak.dict, id)
local dict = moonspeak.dict
local lang = moonspeak.lang
local msg = dict and dict[id] or nil
if msg ~= nil and msg[lang] then
-- Found localized string.

Loading…
Cancel
Save