diff --git a/gamecore/lang.lua b/gamecore/lang.lua index 098c0df..d5b922b 100644 --- a/gamecore/lang.lua +++ b/gamecore/lang.lua @@ -31,8 +31,8 @@ local TRANSLATION_PATH = "datas/languages/" function LanguageManager:new(controller) self.controller = controller + self.datas = self:getTranslationData() self:setLang(self.controller.options.data.language) - self:getTranslationData() end function LanguageManager:setLang(lang) @@ -46,12 +46,13 @@ end function LanguageManager:getTranslationData() local _path = TRANSLATION_PATH .. "init.lua" local fileinfo = love.filesystem.getInfo(_path) + local datas = nil if fileinfo ~= nil then - self.datas = require(TRANSLATION_PATH) - else - self.datas = nil + datas = require(TRANSLATION_PATH) end + + return datas end function LanguageManager:getStringList(library, file)