From 5cf4e872e55851ae8aa7ed0a54470656b6268a8a Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Mon, 29 Jul 2024 17:51:55 +0200 Subject: [PATCH] Capitalize sync instruction strings returned by Progress::asActionString. Signed-off-by: Camila Ayres --- src/gui/folderstatusmodel.cpp | 23 ++++++++--------------- src/libsync/progressdispatcher.cpp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index 1c38cb59f2b3c..7cec18b5c1579 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -1057,23 +1057,16 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) QString fileProgressString; if (ProgressInfo::isSizeDependent(curItem)) { - //quint64 estimatedBw = progress.fileProgress(curItem).estimatedBandwidth; if (estimatedUpBw || estimatedDownBw) { - /* - //: Example text: "uploading foobar.png (1MB of 2MB) time left 2 minutes at a rate of 24Kb/s" - fileProgressString = tr("%1 %2 (%3 of %4) %5 left at a rate of %6/s") - .arg(kindString, itemFileName, s1, s2, - Utility::durationToDescriptiveString(progress.fileProgress(curItem).estimatedEta), - Utility::octetsToString(estimatedBw) ); - */ + //: Example text: "Uploading foobar.png (1MB of 2MB) time left 2 minutes at a rate of 24Kb/s" //: Example text: "Syncing 'foo.txt', 'bar.txt'" fileProgressString = tr("Syncing %1").arg(allFilenames); if (estimatedDownBw > 0) { fileProgressString.append(tr(", ")); // ifdefs: https://github.com/owncloud/client/issues/3095#issuecomment-128409294 #ifdef Q_OS_WIN - //: Example text: "download 24Kb/s" (%1 is replaced by 24Kb (translated)) - fileProgressString.append(tr("download %1/s").arg(Utility::octetsToString(estimatedDownBw))); + //: Example text: "Download 24Kb/s" (%1 is replaced by 24Kb (translated)) + fileProgressString.append(tr("Download %1/s").arg(Utility::octetsToString(estimatedDownBw))); #else fileProgressString.append(tr("\u2193 %1/s") .arg(Utility::octetsToString(estimatedDownBw))); @@ -1082,21 +1075,21 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) if (estimatedUpBw > 0) { fileProgressString.append(tr(", ")); #ifdef Q_OS_WIN - //: Example text: "upload 24Kb/s" (%1 is replaced by 24Kb (translated)) - fileProgressString.append(tr("upload %1/s").arg(Utility::octetsToString(estimatedUpBw))); + //: Example text: "Upload 24Kb/s" (%1 is replaced by 24Kb (translated)) + fileProgressString.append(tr("Upload %1/s").arg(Utility::octetsToString(estimatedUpBw))); #else fileProgressString.append(tr("\u2191 %1/s") .arg(Utility::octetsToString(estimatedUpBw))); #endif } } else { - //: Example text: "uploading foobar.png (2MB of 2MB)" + //: Example text: "Uploading foobar.png (2MB of 2MB)" fileProgressString = tr("%1 %2 (%3 of %4)").arg(kindString, itemFileName, Utility::octetsToString(curItemProgress), Utility::octetsToString(curItem._size)); } } else if (!kindString.isEmpty()) { - //: Example text: "uploading foobar.png" + //: Example text: "Uploading foobar.png" fileProgressString = tr("%1 %2").arg(kindString, itemFileName); } subFolderProgress->_progressString = fileProgressString; @@ -1139,7 +1132,7 @@ void FolderStatusModel::slotSetProgress(const ProgressInfo &progress) } } else if (totalFileCount > 0 && currentFile > 0) { // Don't attempt to estimate the time left if there is no kb to transfer. - overallSyncString = tr("%1 file %2 of %3").arg(kindString).arg(currentFile).arg(totalFileCount); + overallSyncString = tr("File %1 of %2").arg(currentFile).arg(totalFileCount); } subFolderProgress->_overallSyncString = overallSyncString; diff --git a/src/libsync/progressdispatcher.cpp b/src/libsync/progressdispatcher.cpp index ec189b1c97032..b656d6adadbe0 100644 --- a/src/libsync/progressdispatcher.cpp +++ b/src/libsync/progressdispatcher.cpp @@ -74,23 +74,23 @@ QString Progress::asActionString(const SyncFileItem &item) case CSYNC_INSTRUCTION_NEW: case CSYNC_INSTRUCTION_TYPE_CHANGE: if (item._direction != SyncFileItem::Up) - return QCoreApplication::translate("progress", "downloading"); + return QCoreApplication::translate("progress", "Downloading"); else - return QCoreApplication::translate("progress", "uploading"); + return QCoreApplication::translate("progress", "Uploading"); case CSYNC_INSTRUCTION_REMOVE: - return QCoreApplication::translate("progress", "deleting"); + return QCoreApplication::translate("progress", "Deleting"); case CSYNC_INSTRUCTION_EVAL_RENAME: case CSYNC_INSTRUCTION_RENAME: - return QCoreApplication::translate("progress", "moving"); + return QCoreApplication::translate("progress", "Moving"); case CSYNC_INSTRUCTION_IGNORE: - return QCoreApplication::translate("progress", "ignoring"); + return QCoreApplication::translate("progress", "Ignoring"); case CSYNC_INSTRUCTION_STAT_ERROR: case CSYNC_INSTRUCTION_ERROR: - return QCoreApplication::translate("progress", "error"); + return QCoreApplication::translate("progress", "Error"); case CSYNC_INSTRUCTION_UPDATE_METADATA: - return QCoreApplication::translate("progress", "updating local metadata"); + return QCoreApplication::translate("progress", "Updating local metadata"); case CSYNC_INSTRUCTION_UPDATE_VFS_METADATA: - return QCoreApplication::translate("progress", "updating local virtual files metadata"); + return QCoreApplication::translate("progress", "Updating local virtual files metadata"); case CSYNC_INSTRUCTION_NONE: case CSYNC_INSTRUCTION_EVAL: break;