summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gui/pages.cpp3
-rw-r--r--gui/pages.hpp5
2 files changed, 8 insertions, 0 deletions
diff --git a/gui/pages.cpp b/gui/pages.cpp
index 4a4c52361..cfe306773 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -36,6 +36,7 @@
#include "../partitions.hpp"
#include <string>
+#include <algorithm>
extern "C" {
#include "../twcommon.h"
@@ -1333,6 +1334,8 @@ void PageManager::LoadLanguageList(ZipArchive* package) {
} else {
LoadLanguageListDir(TWRES "languages/");
}
+
+ std::sort(Language_List.begin(), Language_List.end());
}
void PageManager::LoadLanguage(string filename) {
diff --git a/gui/pages.hpp b/gui/pages.hpp
index cf1afa1e9..927f3fc01 100644
--- a/gui/pages.hpp
+++ b/gui/pages.hpp
@@ -34,6 +34,11 @@ struct language_struct {
std::string displayvalue;
};
+inline bool operator < (const language_struct& language1, const language_struct& language2)
+{
+ return language1.displayvalue < language2.displayvalue;
+}
+
extern std::vector<language_struct> Language_List;
// Utility Functions