From e02c443ec50c4ddb7aa2a897da7835fd067bb609 Mon Sep 17 00:00:00 2001 From: upstream svn Date: Fri, 7 Oct 2011 22:32:01 +0000 Subject: [PATCH] - Don't check if custom language packs are available (it asserts on some systems) - Show warning dialog if "Change language" is selected and no languages are installed. --- .svn-revision | 2 +- src/Preferences.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.svn-revision b/.svn-revision index 1e9f4352..45ff58ec 100644 --- a/.svn-revision +++ b/.svn-revision @@ -1 +1 @@ -10630 +10631 diff --git a/src/Preferences.cpp b/src/Preferences.cpp index de2de00c..58fafe90 100644 --- a/src/Preferences.cpp +++ b/src/Preferences.cpp @@ -740,12 +740,12 @@ public: // time when the settings dialog is opened for the first time. wxBusyCursor busyCursor; aMuleLanguages[0].displayname = wxGetTranslation(aMuleLanguages[0].name); + + // This supresses error-messages about invalid locales for (unsigned int i = 1; i < itemsof(aMuleLanguages); ++i) { - if (wxLocale::IsAvailable(aMuleLanguages[i].id)) { - // This supresses error-messages about invalid locales. + if ((aMuleLanguages[i].id > wxLANGUAGE_USER_DEFINED) || wxLocale::IsAvailable(aMuleLanguages[i].id)) { wxLogNull logTarget; wxLocale locale_to_check; - InitLocale(locale_to_check, aMuleLanguages[i].id); if (locale_to_check.IsOk() && locale_to_check.IsLoaded(wxT(PACKAGE))) { aMuleLanguages[i].displayname = wxString(wxGetTranslation(aMuleLanguages[i].name)) + wxT(" [") + aMuleLanguages[i].name + wxT("]"); @@ -766,6 +766,9 @@ public: wxLocale tmpLocale; InitLocale(tmpLocale, theApp->m_locale.GetLanguage()); FillChoice(); + if (m_langSelector->GetCount() == 1) { + wxMessageBox(_("There are no translations installed for aMule"), _("No languages available"), wxICON_INFORMATION | wxOK); + } m_langSelector->SetSelection(m_selection); m_languagesReady = true; } -- 2.11.4.GIT