diff --git a/src/common/filesystembase.cpp b/src/common/filesystembase.cpp index 78c94fe77c9f3..57e67ffcd1f81 100644 --- a/src/common/filesystembase.cpp +++ b/src/common/filesystembase.cpp @@ -395,13 +395,13 @@ bool FileSystem::moveToTrash(const QString &fileName, QString *errorString) suffix_number++; } if (!file.rename(f.absoluteFilePath(), path + QString::number(suffix_number))) { // rename(file old path, file trash path) - *errorString = QCoreApplication::translate("FileSystem", "Could not move '%1' to '%2'") + *errorString = QCoreApplication::translate("FileSystem", R"(Could not move "%1" to "%1")") .arg(f.absoluteFilePath(), path + QString::number(suffix_number)); return false; } } else { if (!file.rename(f.absoluteFilePath(), trashFilePath + f.fileName())) { // rename(file old path, file trash path) - *errorString = QCoreApplication::translate("FileSystem", "Could not move '%1' to '%2'") + *errorString = QCoreApplication::translate("FileSystem", R"(Could not move "%1" to "%1")") .arg(f.absoluteFilePath(), trashFilePath + f.fileName()); return false; } diff --git a/src/gui/authenticationdialog.cpp b/src/gui/authenticationdialog.cpp index c04176e1582d1..1cc8e95ee4285 100644 --- a/src/gui/authenticationdialog.cpp +++ b/src/gui/authenticationdialog.cpp @@ -29,7 +29,7 @@ AuthenticationDialog::AuthenticationDialog(const QString &realm, const QString & { setWindowTitle(tr("Authentication Required")); auto *lay = new QVBoxLayout(this); - auto *label = new QLabel(tr("Enter username and password for '%1' at %2.").arg(realm, domain)); + auto *label = new QLabel(tr("Enter username and password for \"%1\" at %2.").arg(realm, domain)); label->setTextFormat(Qt::PlainText); lay->addWidget(label); diff --git a/src/gui/cloudproviders/cloudproviderwrapper.cpp b/src/gui/cloudproviders/cloudproviderwrapper.cpp index bdfce741d0ad4..04ae01c85af04 100644 --- a/src/gui/cloudproviders/cloudproviderwrapper.cpp +++ b/src/gui/cloudproviders/cloudproviderwrapper.cpp @@ -119,7 +119,7 @@ void CloudProviderWrapper::slotUpdateProgress(const QString &folder, const Progr // Build status details text QString msg; if (!progress._currentDiscoveredRemoteFolder.isEmpty()) { - msg = tr("Checking for changes in '%1'").arg(progress._currentDiscoveredRemoteFolder); + msg = tr("Checking for changes in \"%1\"").arg(progress._currentDiscoveredRemoteFolder); } else if (progress.totalSize() == 0) { qint64 currentFile = progress.currentFile(); qint64 totalFileCount = qMax(progress.totalFiles(), currentFile); diff --git a/src/gui/creds/flow2auth.cpp b/src/gui/creds/flow2auth.cpp index 4eb626d3c7fc6..b94de0afd858f 100644 --- a/src/gui/creds/flow2auth.cpp +++ b/src/gui/creds/flow2auth.cpp @@ -115,7 +115,7 @@ void Flow2Auth::fetchNewToken(const TokenAction action) errorReason = tr("Error returned from the server: %1") .arg(errorFromJson.toHtmlEscaped()); } else if (reply->error() != QNetworkReply::NoError) { - errorReason = tr("There was an error accessing the 'token' endpoint:
%1") + errorReason = tr("There was an error accessing the \"token\" endpoint:
%1") .arg(reply->errorString().toHtmlEscaped()); } else if (jsonParseError.error != QJsonParseError::NoError) { errorReason = tr("Could not parse the JSON returned from the server:
%1") @@ -223,7 +223,7 @@ void Flow2Auth::slotPollTimerTimeout() errorReason = tr("Error returned from the server: %1") .arg(errorFromJson.toHtmlEscaped()); } else if (reply->error() != QNetworkReply::NoError) { - errorReason = tr("There was an error accessing the 'token' endpoint:
%1") + errorReason = tr("There was an error accessing the \"token\" endpoint:
%1") .arg(reply->errorString().toHtmlEscaped()); } else if (jsonParseError.error != QJsonParseError::NoError) { errorReason = tr("Could not parse the JSON returned from the server:
%1") diff --git a/src/gui/creds/httpcredentialsgui.cpp b/src/gui/creds/httpcredentialsgui.cpp index f8e3e5f9bf67a..7e574b8f7e53f 100644 --- a/src/gui/creds/httpcredentialsgui.cpp +++ b/src/gui/creds/httpcredentialsgui.cpp @@ -108,7 +108,7 @@ void HttpCredentialsGui::showDialog() } if (!_fetchErrorString.isEmpty()) { msg += QLatin1String("
") - + tr("Reading from keychain failed with error: '%1'") + + tr("Reading from keychain failed with error: \"%1\"") .arg(Utility::escape(_fetchErrorString)) + QLatin1String("
"); } diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 18908dd6964c4..b5bc8007c8d56 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -1252,12 +1252,12 @@ void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction dir, std::functio return; } - const QString msg = dir == SyncFileItem::Down ? tr("All files in the sync folder '%1' folder were deleted on the server.\n" + const QString msg = dir == SyncFileItem::Down ? tr("All files in the sync folder \"%1\" folder were deleted on the server.\n" "These deletes will be synchronized to your local sync folder, making such files " "unavailable unless you have a right to restore. \n" "If you decide to restore the files, they will be re-synced with the server if you have rights to do so.\n" "If you decide to delete the files, they will be unavailable to you, unless you are the owner.") - : tr("All the files in your local sync folder '%1' were deleted. These deletes will be " + : tr("All the files in your local sync folder \"%1\" were deleted. These deletes will be " "synchronized with your server, making such files unavailable unless restored.\n" "Are you sure you want to sync those actions with the server?\n" "If this was an accident and you decide to keep your files, they will be re-synced from the server."); diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index 03268939ce67b..7f7f499c068c7 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -387,7 +387,7 @@ bool FolderMan::ensureJournalGone(const QString &journalDbFile) while (QFile::exists(journalDbFile) && !QFile::remove(journalDbFile)) { qCWarning(lcFolderMan) << "Could not remove old db file at" << journalDbFile; int ret = QMessageBox::warning(nullptr, tr("Could not reset folder state"), - tr("An old sync journal '%1' was found, " + tr("An old sync journal \"%1\" was found, " "but could not be removed. Please make sure " "that no application is currently using it.") .arg(QDir::fromNativeSeparators(QDir::cleanPath(journalDbFile))), diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index dc4cf2e371918..3ffc048497c6b 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -970,11 +970,11 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) if (progress.status() == ProgressInfo::Discovery) { if (!progress._currentDiscoveredRemoteFolder.isEmpty()) { - pi->_overallSyncString = tr("Checking for changes in remote '%1'").arg(progress._currentDiscoveredRemoteFolder); + pi->_overallSyncString = tr("Checking for changes in remote \"%1\"").arg(progress._currentDiscoveredRemoteFolder); emit dataChanged(index(folderIndex), index(folderIndex), roles); return; } else if (!progress._currentDiscoveredLocalFolder.isEmpty()) { - pi->_overallSyncString = tr("Checking for changes in local '%1'").arg(progress._currentDiscoveredLocalFolder); + pi->_overallSyncString = tr("Checking for changes in local \"%1\"").arg(progress._currentDiscoveredLocalFolder); emit dataChanged(index(folderIndex), index(folderIndex), roles); return; } diff --git a/src/gui/folderwizard.cpp b/src/gui/folderwizard.cpp index e8a3231a010ee..b55cb58e961b5 100644 --- a/src/gui/folderwizard.cpp +++ b/src/gui/folderwizard.cpp @@ -181,7 +181,7 @@ void FolderWizardRemotePath::slotAddRemoteFolder() auto *dlg = new QInputDialog(this); dlg->setWindowTitle(tr("Create Remote Folder")); - dlg->setLabelText(tr("Enter the name of the new folder to be created below '%1':") + dlg->setLabelText(tr("Enter the name of the new folder to be created below \"%1\":") .arg(parent)); dlg->open(this, SLOT(slotCreateRemoteFolder(QString))); dlg->setAttribute(Qt::WA_DeleteOnClose); diff --git a/src/gui/ignorelisteditor.cpp b/src/gui/ignorelisteditor.cpp index 6e5a3d784d499..aba85c5cbe3c3 100644 --- a/src/gui/ignorelisteditor.cpp +++ b/src/gui/ignorelisteditor.cpp @@ -37,7 +37,7 @@ IgnoreListEditor::IgnoreListEditor(QWidget *parent) ConfigFile cfgFile; //FIXME This is not true. The entries are hardcoded below in setupTableReadOnlyItems - readOnlyTooltip = tr("This entry is provided by the system at '%1' " + readOnlyTooltip = tr("This entry is provided by the system at \"%1\" " "and cannot be modified in this view.") .arg(QDir::toNativeSeparators(cfgFile.excludeFile(ConfigFile::SystemScope))); diff --git a/src/gui/ignorelisttablewidget.cpp b/src/gui/ignorelisttablewidget.cpp index a9f5dae5b8e69..8e93630a721f4 100644 --- a/src/gui/ignorelisttablewidget.cpp +++ b/src/gui/ignorelisttablewidget.cpp @@ -91,7 +91,7 @@ void IgnoreListTableWidget::slotWriteIgnoreFile(const QString & file) } } else { QMessageBox::warning(this, tr("Could not open file"), - tr("Cannot write changes to '%1'.").arg(file)); + tr("Cannot write changes to \"%1\".").arg(file)); } ignores.close(); //close the file before reloading stuff. diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index 2ea6d9052923e..f4aeef11a0d3b 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -415,10 +415,10 @@ void ownCloudGui::slotUpdateProgress(const QString &folder, const ProgressInfo & if (progress.status() == ProgressInfo::Discovery) { #if 0 if (!progress._currentDiscoveredRemoteFolder.isEmpty()) { - _actionStatus->setText(tr("Checking for changes in remote '%1'") + _actionStatus->setText(tr("Checking for changes in remote \"%1\"") .arg(progress._currentDiscoveredRemoteFolder)); } else if (!progress._currentDiscoveredLocalFolder.isEmpty()) { - _actionStatus->setText(tr("Checking for changes in local '%1'") + _actionStatus->setText(tr("Checking for changes in local \"%1\"") .arg(progress._currentDiscoveredLocalFolder)); } #endif diff --git a/src/gui/owncloudsetupwizard.cpp b/src/gui/owncloudsetupwizard.cpp index 2972f0b11cad2..ce0dd773fb4e7 100644 --- a/src/gui/owncloudsetupwizard.cpp +++ b/src/gui/owncloudsetupwizard.cpp @@ -376,7 +376,7 @@ void OwncloudSetupWizard::slotAuthError() return; } errorMsg = tr("The authenticated request to the server was redirected to " - "'%1'. The URL is bad, the server is misconfigured.") + "\"%1\". The URL is bad, the server is misconfigured.") .arg(Utility::escape(redirectUrl.toString())); // A 404 is actually a success: we were authorized to know that the folder does diff --git a/src/gui/shareusergroupwidget.cpp b/src/gui/shareusergroupwidget.cpp index e6098c19e9e0a..47e6ebc6cca0e 100644 --- a/src/gui/shareusergroupwidget.cpp +++ b/src/gui/shareusergroupwidget.cpp @@ -334,7 +334,7 @@ void ShareUserGroupWidget::slotShareesReady() _pi_sharee.stopAnimation(); if (_completerModel->rowCount() == 0) { - displayError(0, tr("No results for '%1'").arg(_completerModel->currentSearch())); + displayError(0, tr("No results for \"%1\"").arg(_completerModel->currentSearch())); } // if no rows are present in the model - complete() will hide the completer diff --git a/src/gui/wizard/owncloudadvancedsetuppage.cpp b/src/gui/wizard/owncloudadvancedsetuppage.cpp index 59ebb955cf23f..51ea0eb9ce335 100644 --- a/src/gui/wizard/owncloudadvancedsetuppage.cpp +++ b/src/gui/wizard/owncloudadvancedsetuppage.cpp @@ -267,10 +267,10 @@ void OwncloudAdvancedSetupPage::updateStatus() if (_remoteFolder.isEmpty() || _remoteFolder == QLatin1String("/")) { t = ""; } else { - t = Utility::escape(tr("%1 folder '%2' is synced to local folder '%3'") + t = Utility::escape(tr(R"(%1 folder "%2" is synced to local folder "%3")") .arg(Theme::instance()->appName(), _remoteFolder, QDir::toNativeSeparators(locFolder))); - _ui.rSyncEverything->setText(tr("Sync the folder '%1'").arg(_remoteFolder)); + _ui.rSyncEverything->setText(tr("Sync the folder \"%1\"").arg(_remoteFolder)); } const bool dirNotEmpty(QDir(locFolder).entryList(QDir::AllEntries | QDir::NoDotAndDotDot).count() > 0); diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index bd39c6ae8fed0..7ca23b807bb29 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -269,7 +269,7 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const QString &loc } } if (invalid) { - item->_errorString = tr("File names containing the character '%1' are not supported on this file system.") + item->_errorString = tr("File names containing the character \"%1\" are not supported on this file system.") .arg(QLatin1Char(invalid)); } if (isInvalidPattern) { @@ -1545,7 +1545,7 @@ DiscoverySingleDirectoryJob *ProcessDirectoryJob::startAsyncServerQuery() emit this->finished(); } else { // Fatal for the root job since it has no SyncFileItem, or for the network errors - emit _discoveryData->fatalError(tr("Server replied with an error while reading directory '%1' : %2") + emit _discoveryData->fatalError(tr("Server replied with an error while reading directory \"%1\" : %2") .arg(_currentFolder._server, results.error().message)); } } diff --git a/src/libsync/filesystem.cpp b/src/libsync/filesystem.cpp index 8f71d173b62fa..af84f4d2fe2ef 100644 --- a/src/libsync/filesystem.cpp +++ b/src/libsync/filesystem.cpp @@ -155,7 +155,7 @@ bool FileSystem::removeRecursively(const QString &path, const std::functionappend(QCoreApplication::translate("FileSystem", "Error removing '%1': %2") + errors->append(QCoreApplication::translate("FileSystem", "Error removing \"%1\": %2") .arg(QDir::toNativeSeparators(di.filePath()), removeError)); } qCWarning(lcFileSystem) << "Error removing " << di.filePath() << ':' << removeError; @@ -171,7 +171,7 @@ bool FileSystem::removeRecursively(const QString &path, const std::functionappend(QCoreApplication::translate("FileSystem", "Could not remove folder '%1'") + errors->append(QCoreApplication::translate("FileSystem", "Could not remove folder \"%1\"") .arg(QDir::toNativeSeparators(path))); } qCWarning(lcFileSystem) << "Error removing folder" << path; diff --git a/src/libsync/logger.cpp b/src/libsync/logger.cpp index 9a45e6059d1e7..acf50f6561c6f 100644 --- a/src/libsync/logger.cpp +++ b/src/libsync/logger.cpp @@ -192,7 +192,7 @@ void Logger::setLogFile(const QString &name) if (!openSucceeded) { locker.unlock(); // Just in case postGuiMessage has a qDebug() postGuiMessage(tr("Error"), - QString(tr("File '%1'
cannot be opened for writing.

" + QString(tr("
File \"%1\"
cannot be opened for writing.

" "The log output can not be saved!
")) .arg(name)); return; diff --git a/test/testremotediscovery.cpp b/test/testremotediscovery.cpp index cf27ae1c279c8..2df07b0db2acd 100644 --- a/test/testremotediscovery.cpp +++ b/test/testremotediscovery.cpp @@ -92,7 +92,7 @@ private slots: auto oldRemoteState = fakeFolder.currentRemoteState(); QString errorFolder = "dav/files/admin/B"; - QString fatalErrorPrefix = "Server replied with an error while reading directory 'B' : "; + QString fatalErrorPrefix = "Server replied with an error while reading directory \"B\" : "; fakeFolder.setServerOverride([&](QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *) -> QNetworkReply *{ if (req.attribute(QNetworkRequest::CustomVerbAttribute) == "PROPFIND" && req.url().path().endsWith(errorFolder)) { @@ -134,7 +134,7 @@ private slots: // Check the same discovery error on the sync root // errorFolder = "dav/files/admin/"; - fatalErrorPrefix = "Server replied with an error while reading directory '' : "; + fatalErrorPrefix = "Server replied with an error while reading directory \"\" : "; errorSpy.clear(); QVERIFY(!fakeFolder.syncOnce()); QCOMPARE(errorSpy.size(), 1);