From 439a2c547e67b3492329683c6f8cc24a37712981 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Mon, 12 Jan 2009 21:20:53 +0000 Subject: [PATCH] * 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. --- aegisub/aegisublocale.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/aegisub/aegisublocale.cpp b/aegisub/aegisublocale.cpp index d76230b2d..4323c8da7 100644 --- a/aegisub/aegisublocale.cpp +++ b/aegisub/aegisublocale.cpp @@ -46,7 +46,7 @@ #include #include "aegisublocale.h" #include "standard_paths.h" - +#include /////////////// // Constructor @@ -150,6 +150,7 @@ wxArrayInt AegisubLocale::GetAvailableLanguages() { _T("fr_FR"), _T("hu"), _T("it"), + _T("ja"), _T("ko"), _T("ru"), _T("pt_BR"), @@ -159,9 +160,12 @@ wxArrayInt AegisubLocale::GetAvailableLanguages() { size_t len = sizeof(langs)/sizeof(wchar_t*); for (size_t i=0; iLanguage); - } + // 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 return final;