From 923c1e6dfd15b359d80620237d4acda3aed06849 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 9 Sep 2020 22:40:07 +0100 Subject: [PATCH] I18n for some error messages --- logbook/WorkedBefore.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/logbook/WorkedBefore.cpp b/logbook/WorkedBefore.cpp index d6a794108..e7214d41b 100644 --- a/logbook/WorkedBefore.cpp +++ b/logbook/WorkedBefore.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -254,7 +255,7 @@ namespace } else { - throw LoaderException (std::runtime_error {"Invalid ADIF field " + fieldName.toStdString () + ": " + record.toStdString ()}); + throw LoaderException (std::runtime_error {QCoreApplication::translate ("WorkedBefore", "Invalid ADIF field %0: %1").arg (fieldName).arg (record).toLocal8Bit ()}); } if (closingBracketIndex > fieldNameIndex && fieldLengthIndex > fieldNameIndex && fieldLengthIndex < closingBracketIndex) @@ -271,7 +272,7 @@ namespace } else { - throw LoaderException (std::runtime_error {"Malformed ADIF field " + fieldName.toStdString () + ": " + record.toStdString ()}); + throw LoaderException (std::runtime_error {QCoreApplication::translate ("WorkedBefore", "Malformed ADIF field %0: %1").arg (fieldName).arg (record).toLocal8Bit ()}); } } return QString {}; @@ -308,7 +309,7 @@ namespace { if (end_position < 0) { - throw LoaderException (std::runtime_error {"Invalid ADIF header"}); + throw LoaderException (std::runtime_error {QCoreApplication::translate ("WorkedBefore", "Invalid ADIF header").toLocal8Bit ()}); } buffer.remove (0, end_position + 5); } @@ -354,7 +355,7 @@ namespace } else { - throw LoaderException (std::runtime_error {"Error opening ADIF log file for read: " + inputFile.errorString ().toStdString ()}); + throw LoaderException (std::runtime_error {QCoreApplication::translate ("WorkedBefore", "Error opening ADIF log file for read: %0").arg (inputFile.errorString ()).toLocal8Bit ()}); } } return worked;