From 1e215a99bf6b6e348ffcde192be3e209e5eb853c Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 13 Apr 2019 19:00:03 +0200 Subject: [PATCH] lang: improve data handling --- gamecore/lang.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gamecore/lang.lua b/gamecore/lang.lua index 0d79e6b..0e0f33d 100644 --- a/gamecore/lang.lua +++ b/gamecore/lang.lua @@ -32,7 +32,7 @@ local TRANSLATION_PATH = "datas/languages/" function LanguageManager:new(controller) self.controller = controller - self.datas = self:getTranslationData() + self.data = self:getTranslationData() self:setLang(self.controller.options.data.language.current) end @@ -44,6 +44,14 @@ end -- INFO FUNCTIONS -- 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() return self.controller.options.data.language end