diff --git a/gui/pages.cpp b/gui/pages.cpp index 4a4c5236..cfe30677 100644 --- a/gui/pages.cpp +++ b/gui/pages.cpp @@ -36,6 +36,7 @@ #include "../partitions.hpp" #include +#include 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 cf1afa1e..927f3fc0 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_List; // Utility Functions