Skip to content

Commit

Permalink
Capitalize sync instruction strings returned by Progress::asActionStr…
Browse files Browse the repository at this point in the history
…ing.

Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan authored and backportbot[bot] committed Jul 30, 2024
1 parent 7b807c4 commit ca58b56
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
23 changes: 8 additions & 15 deletions src/gui/folderstatusmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1056,23 +1056,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)));
Expand All @@ -1081,21 +1074,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;
Expand Down Expand Up @@ -1138,7 +1131,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;

Expand Down
16 changes: 8 additions & 8 deletions src/libsync/progressdispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ca58b56

Please sign in to comment.