diff options
Diffstat (limited to 'src/strings.cpp')
-rw-r--r-- | src/strings.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index eae48281a..57b3111c2 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -1101,6 +1101,8 @@ StringID RemapOldStringID(StringID s) } } +extern void SortNetworkLanguages(); + bool ReadLanguagePack(int lang_index) { int tot_count, i; @@ -1156,6 +1158,7 @@ bool ReadLanguagePack(int lang_index) _dynlang.curr = lang_index; SetCurrentGrfLangID(_langpack->isocode); + SortNetworkLanguages(); return true; } @@ -1191,6 +1194,18 @@ static int CDECL LanguageCompareFunc(const void *a, const void *b) return strcmp(cmp1->file, cmp2->file); } +int CDECL StringIDSorter(const void *a, const void *b) +{ + const StringID va = *(const StringID*)a; + const StringID vb = *(const StringID*)b; + char stra[512]; + char strb[512]; + GetString(stra, va, lastof(stra)); + GetString(strb, vb, lastof(strb)); + + return strcmp(stra, strb); +} + /** * Checks whether the given language is already found. * @param langs languages we've found so fa |