GUI: Improve the error message for language loading error.

This commit is contained in:
Kimmo Varis 2011-04-04 23:09:01 +03:00
parent 4ac3c7fe3b
commit f498e53cd2
1 changed files with 11 additions and 7 deletions

View File

@ -678,13 +678,17 @@ void MainWindow::SetLanguage(const QString &code)
QString error; QString error;
if (!mTranslation->SetLanguage(code, error)) if (!mTranslation->SetLanguage(code, error))
{ {
QMessageBox msg(QMessageBox::Critical, const QString msg(tr("Failed to change the user interface language:"
tr("Cppcheck"), "\n\n%1\n\n"
QString(tr("Failed to change the language:\n\n%1")).arg(error), "The user interface language has been reset to English. Open "
QMessageBox::Ok, "the Preferences-dialog to select any of the available "
this); "languages.").arg(error));
QMessageBox msgBox(QMessageBox::Warning,
msg.exec(); tr("Cppcheck"),
msg,
QMessageBox::Ok,
this);
msgBox.exec();
} }
else else
{ {