forked from mia/Aegisub
* Only list languages if they're actually installed (checking for the existence
of the actual .mo file) * Add ja to the list of possbile translations. Originally committed to SVN as r2685.
This commit is contained in:
parent
c476b7b883
commit
439a2c547e
1 changed files with 7 additions and 3 deletions
|
@ -46,7 +46,7 @@
|
||||||
#include <wx/choicdlg.h>
|
#include <wx/choicdlg.h>
|
||||||
#include "aegisublocale.h"
|
#include "aegisublocale.h"
|
||||||
#include "standard_paths.h"
|
#include "standard_paths.h"
|
||||||
|
#include <wx/stdpaths.h>
|
||||||
|
|
||||||
///////////////
|
///////////////
|
||||||
// Constructor
|
// Constructor
|
||||||
|
@ -150,6 +150,7 @@ wxArrayInt AegisubLocale::GetAvailableLanguages() {
|
||||||
_T("fr_FR"),
|
_T("fr_FR"),
|
||||||
_T("hu"),
|
_T("hu"),
|
||||||
_T("it"),
|
_T("it"),
|
||||||
|
_T("ja"),
|
||||||
_T("ko"),
|
_T("ko"),
|
||||||
_T("ru"),
|
_T("ru"),
|
||||||
_T("pt_BR"),
|
_T("pt_BR"),
|
||||||
|
@ -159,9 +160,12 @@ wxArrayInt AegisubLocale::GetAvailableLanguages() {
|
||||||
size_t len = sizeof(langs)/sizeof(wchar_t*);
|
size_t len = sizeof(langs)/sizeof(wchar_t*);
|
||||||
for (size_t i=0; i<len; i++) {
|
for (size_t i=0; i<len; i++) {
|
||||||
const wxLanguageInfo *lang = wxLocale::FindLanguageInfo(langs[i]);
|
const wxLanguageInfo *lang = wxLocale::FindLanguageInfo(langs[i]);
|
||||||
if (lang) final.Add(lang->Language);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// If the locale file doesn't exist then don't list it as an option.
|
||||||
|
wxString locDir = wxStandardPaths::Get().GetLocalizedResourcesDir(langs[i], wxStandardPathsBase::ResourceCat_Messages);
|
||||||
|
wxFileName file(wxString::Format(_T("%s/%s.mo"), locDir.c_str(), _T(GETTEXT_PACKAGE)));
|
||||||
|
if (lang && file.FileExists()) final.Add(lang->Language);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return final;
|
return final;
|
||||||
|
|
Loading…
Reference in a new issue