lang: adapt lang name functions to the new medata format
This commit is contained in:
parent
1e215a99bf
commit
37b6613c4a
1 changed files with 10 additions and 4 deletions
|
@ -60,14 +60,20 @@ function LanguageManager:getStringList(library, file)
|
||||||
return require(self.lang .. "." .. library .. "." .. file)
|
return require(self.lang .. "." .. library .. "." .. file)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function LanguageManager:getLangMetadata(lang)
|
||||||
|
local langfilepath = self.data.path .. lang
|
||||||
|
|
||||||
|
return require(langfilepath)
|
||||||
|
end
|
||||||
|
|
||||||
function LanguageManager:getLangName(lang)
|
function LanguageManager:getLangName(lang)
|
||||||
local langnames = langs.available_langs
|
local metadata = self:getLangMetadata(lang)
|
||||||
return langnames[lang]
|
|
||||||
|
return metadata.name
|
||||||
end
|
end
|
||||||
|
|
||||||
function LanguageManager:getCurrentLangName()
|
function LanguageManager:getCurrentLangName()
|
||||||
local langnames = langs.available_langs
|
return self:getLangName(self.data.current)
|
||||||
return langnames[self.lang]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return LanguageManager
|
return LanguageManager
|
||||||
|
|
Loading…
Reference in a new issue