diff options
Diffstat (limited to 'common/language.cpp')
-rw-r--r-- | common/language.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/common/language.cpp b/common/language.cpp index 1de01b0207..898adf8d0e 100644 --- a/common/language.cpp +++ b/common/language.cpp @@ -20,6 +20,7 @@ */ #include "common/language.h" +#include "common/gui_options.h" #include "common/str.h" namespace Common { @@ -104,4 +105,21 @@ const char *getLanguageDescription(Language id) { return 0; } +bool checkGameGUIOptionLanguage(Language lang, const String &str) { + if (!str.contains("lang_")) // If no languages are specified + return true; + + if (str.contains(getGameGUIOptionsDescriptionLanguage(lang))) + return true; + + return false; +} + +const String getGameGUIOptionsDescriptionLanguage(Language lang) { + if (lang == UNK_LANG) + return ""; + + return String("lang_") + getLanguageDescription(lang); +} + } // End of namespace Common |