From a07c7e433301c8b9bdfa4d202fc286f907df8b31 Mon Sep 17 00:00:00 2001 From: luz paz Date: Mon, 22 Nov 2021 09:55:16 -0500 Subject: [PATCH] Gui: remove superfluous whitespace from translation string Avoids possible translation mistakes by only exposing non-whitespace strings. --- src/Gui/CommandPyImp.cpp | 2 +- src/Gui/Document.cpp | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/Gui/CommandPyImp.cpp b/src/Gui/CommandPyImp.cpp index 332434ce65..853c19bf5d 100644 --- a/src/Gui/CommandPyImp.cpp +++ b/src/Gui/CommandPyImp.cpp @@ -101,7 +101,7 @@ PyObject* CommandPy::listByShortcut(PyObject *args) re.setCaseSensitivity(Qt::CaseInsensitive); if (!re.isValid()){ std::stringstream str; - str << "Invalid regular expression: " << shortcut_to_find; + str << "Invalid regular expression:" << ' ' << shortcut_to_find; throw Py::RuntimeError(str.str()); } diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index d5110459e2..04ac6abeff 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -1081,15 +1081,21 @@ static bool checkCanonicalPath(const std::map &docs) FC_WARN(" Document: " << docName(d).toUtf8().constData() << ": " << d->FileName.getValue()); if (count == 3) { - ts << QObject::tr("\n\nPlease check report view for more..."); + ts << "\n\n" + << QObject::tr("Please check report view for more..."); } else if (count < 3) { - ts << QObject::tr("\n\nPhysical path: ") << v.first - << QObject::tr("\nDocument: ") << docName(doc) - << QObject::tr("\n Path: ") << QString::fromUtf8(doc->FileName.getValue()); + ts << "\n\n" + << QObject::tr("Physical path:") << ' ' << v.first + << "\n" + << QObject::tr("Document:") << ' ' << docName(doc) + << "\n" << ' ' + << QObject::tr("Path:") << ' ' << QString::fromUtf8(doc->FileName.getValue()); for (auto d : v.second) { if (d == doc) continue; - ts << QObject::tr("\nDocument: ") << docName(d) - << QObject::tr("\n Path: ") << QString::fromUtf8(d->FileName.getValue()); + ts << "\n" + << QObject::tr("Document:") << ' ' << docName(d) + << "\n" << ' ' + << QObject::tr("Path:") << ' ' << QString::fromUtf8(d->FileName.getValue()); } } ++count;