lang: adapt lang name functions to the new medata format

This commit is contained in:
Kazhnuz 2019-04-14 11:25:28 +02:00
parent 1e215a99bf
commit 37b6613c4a

View file

@ -60,14 +60,20 @@ function LanguageManager:getStringList(library, file)
return require(self.lang .. "." .. library .. "." .. file)
end
function LanguageManager:getLangMetadata(lang)
local langfilepath = self.data.path .. lang
return require(langfilepath)
end
function LanguageManager:getLangName(lang)
local langnames = langs.available_langs
return langnames[lang]
local metadata = self:getLangMetadata(lang)
return metadata.name
end
function LanguageManager:getCurrentLangName()
local langnames = langs.available_langs
return langnames[self.lang]
return self:getLangName(self.data.current)
end
return LanguageManager