Don't list languages in the language dialog which won't actually work. Updates #1508.

This commit is contained in:
Thomas Goyne 2012-09-22 09:51:39 -07:00
parent 9a6eb70f12
commit 39bf2ab5fd
1 changed files with 5 additions and 0 deletions

View File

@ -37,6 +37,8 @@
#include "config.h" #include "config.h"
#ifndef AGI_PRE #ifndef AGI_PRE
#include <algorithm>
#include <functional>
#include <locale.h> #include <locale.h>
#include <wx/dir.h> #include <wx/dir.h>
@ -120,6 +122,9 @@ int AegisubLocale::PickLanguage() {
langs.Insert(user, 0); langs.Insert(user, 0);
} }
// Remove languages which won't work due to the locale not being installed
langs.erase(remove_if(langs.begin(), langs.end(), not1(std::ptr_fun(&wxLocale::IsAvailable))), langs.end());
// Nothing to pick // Nothing to pick
if (langs.empty()) return -1; if (langs.empty()) return -1;