COMMON: Move language GUIO code to language.h

This commit is contained in:
Max Horn 2012-02-29 12:57:34 +01:00
parent 92d219715f
commit c0d54bdd8d
4 changed files with 25 additions and 21 deletions

View file

@ -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