COMMON: Get accessor methods to the platform and language lists

This commit is contained in:
Eugene Sandulenko 2022-07-22 15:03:48 +02:00
parent b65e00a6ef
commit 30f3e0eceb
No known key found for this signature in database
GPG key ID: 014D387312D34F08
4 changed files with 30 additions and 0 deletions

View file

@ -22,6 +22,7 @@
#include "common/language.h"
#include "common/gui_options.h"
#include "common/str.h"
#include "common/algorithm.h"
namespace Common {
@ -178,4 +179,15 @@ const String getGameGUIOptionsDescriptionLanguage(Language lang) {
return String("lang_") + getLanguageDescription(lang);
}
List<String> getLanguageList() {
List<String> list;
for (const LanguageDescription *l = g_languages; l->code; ++l)
list.push_back(l->code);
Common::sort(list.begin(), list.end());
return list;
}
} // End of namespace Common