diff --git a/init.lua b/init.lua index e235e16..0866a5b 100644 --- a/init.lua +++ b/init.lua @@ -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.