Commit cac6ace1 authored by Xuefer's avatar Xuefer Committed by Dees Troy
Browse files

sort languages by display value


Change-Id: I79d58fd680dd04161b89d42fed04a86a931defd3
Signed-off-by: default avatarXuefer <xuefer@gmail.com>
parent 16d4a1fe
......@@ -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) {
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment