From a470f53f8f4592e70815e4f76548b00403a8ba3d Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 14 Apr 2019 18:11:31 +0200 Subject: [PATCH] lang: add a way to check language availability --- gamecore/lang.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gamecore/lang.lua b/gamecore/lang.lua index 6840988..3691707 100644 --- a/gamecore/lang.lua +++ b/gamecore/lang.lua @@ -72,6 +72,18 @@ function LanguageManager:getCurrentLangName() return self:getLangName(self.data.current) end +function LanguageManager:isLangAvailable(lang) + local isAvailable = false + + for i,v in ipairs(self.data.available) do + if v == lang then + isAvailable = true + end + end + + return isAvailable +end + -- TRANSLATION FUNCTIONS -- get the translation of a string