Add error localiztion

This commit is contained in:
FullGreaM 2026-03-06 19:01:26 +03:00
parent a3cbc27388
commit b11e5ce852

View File

@ -1,5 +1,6 @@
#include "i2p-controller.h"
#include "prog-constains.h"
#include "locales.h"
I2PController::I2PController(QObject *parent)
: QObject(parent)
@ -28,11 +29,13 @@ I2PController::I2PController(QObject *parent)
connect(this, &I2PController::fatalError, [this](QString msg) {
this->isFatalErrored = true;
qCritical() << msg;
LocaleMap* locale = getLocale();
QMessageBox::critical(
nullptr,
"I2P Error",
"A fatal error occurred while running i2pd:\n\n" + msg +
"\n\nThe launcher will now close.",
QString::fromStdString(locale->at("i2pd.errorTitle")),
QString::fromStdString(locale->at("i2pd.errorDescription.p1")) + msg +
QString::fromStdString(locale->at("i2pd.errorDescription.p2")),
QMessageBox::Ok
);
qApp->exit(1);