From c0d54bdd8dcd2235a0258af145fe2528c07c9fc2 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 29 Feb 2012 12:57:34 +0100 Subject: COMMON: Move language GUIO code to language.h --- common/language.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'common/language.cpp') 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 -- cgit v1.2.3