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

View file

@ -37,6 +37,8 @@
#include "config.h"
#ifndef AGI_PRE
#include <algorithm>
#include <functional>
#include <locale.h>
#include <wx/dir.h>
@ -120,6 +122,9 @@ int AegisubLocale::PickLanguage() {
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
if (langs.empty()) return -1;