lang: improve data handling
This commit is contained in:
parent
1c51b35112
commit
1e215a99bf
1 changed files with 9 additions and 1 deletions
|
@ -32,7 +32,7 @@ local TRANSLATION_PATH = "datas/languages/"
|
||||||
function LanguageManager:new(controller)
|
function LanguageManager:new(controller)
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
|
|
||||||
self.datas = self:getTranslationData()
|
self.data = self:getTranslationData()
|
||||||
self:setLang(self.controller.options.data.language.current)
|
self:setLang(self.controller.options.data.language.current)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -44,6 +44,14 @@ end
|
||||||
-- INFO FUNCTIONS
|
-- INFO FUNCTIONS
|
||||||
-- Get informations from the translation manager
|
-- Get informations from the translation manager
|
||||||
|
|
||||||
|
function LanguageManager:getCurrentLang()
|
||||||
|
return self.data.language.current
|
||||||
|
end
|
||||||
|
|
||||||
|
function LanguageManager:getDefaultLang()
|
||||||
|
return self.data.language.default
|
||||||
|
end
|
||||||
|
|
||||||
function LanguageManager:getTranslationData()
|
function LanguageManager:getTranslationData()
|
||||||
return self.controller.options.data.language
|
return self.controller.options.data.language
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue