Skip to content

Commit ed747b6

Browse files
committed
Improvements for translations
- comments for translators - use placeholders instead of concatenating
1 parent 11c331b commit ed747b6

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/gui/FoldersGui/accountfolderscontroller.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ void AccountFoldersController::buildMenuActions()
170170
connect(_chooseSync, &QAction::triggered, this, &AccountFoldersController::onChooseSync);
171171
}
172172

173+
//: This shows as 'Remove folder sync' or 'Remove Space sync'
173174
QString removeSyncString = tr("Remove %1 sync").arg(CommonStrings::space());
174175
_removeSync = new QAction(removeSyncString, this);
175176
_removeSync->setObjectName("removeFolderSyncAction");

src/gui/FoldersGui/accountfoldersview.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ AccountFoldersView::AccountFoldersView(QWidget *parent)
5353
void AccountFoldersView::buildView()
5454
{
5555
QVBoxLayout *mainLayout = new QVBoxLayout();
56+
//: This shows as 'Folder sync' or 'Space sync'
5657
QString titleString = tr("%1 sync").arg(CommonStrings::capSpace());
5758
QLabel *titleLabel = new QLabel(titleString, this);
5859
QFont f = titleLabel->font();
@@ -67,6 +68,7 @@ void AccountFoldersView::buildView()
6768
description->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
6869
buttonLineLayout->addWidget(description, 0, Qt::AlignLeft);
6970

71+
//: This shows as 'Add new folder sync…' or 'Add new Space sync…'
7072
QString addSyncString = tr("Add new %1 sync…").arg(CommonStrings::space());
7173
_addFolderButton = new QPushButton(addSyncString, this);
7274
_addFolderButton->setObjectName("addFolderSyncButton");

src/gui/FoldersGui/folderitem.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,9 @@ QVariant FolderItem::data(int role) const
204204
case Qt::DisplayRole:
205205
return _folder->displayName();
206206
case Qt::AccessibleTextRole: {
207-
QString accessible = _folder->displayName();
208-
accessible.append(tr(" sync status "));
209-
accessible.append(_statusString);
210-
return accessible;
207+
//: Accessible text, read out by a screen reader.
208+
//~ The first argument is the displayed name of the folder.
209+
return tr("%1, sync status: %2").arg(_folder->displayName(), _statusString);
211210
}
212211
case Qt::DecorationRole:
213212
return _image;

src/gui/FoldersGui/folderitemupdater.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ void FolderItemUpdater::onSyncStateChanged()
104104
we " "can't update a known total size using these progress values becausethey are never negative, to indicate a removal"; QStandardItem
105105
*errorItem = new QStandardItem(errorIcon, longError);
106106
*/
107-
QString accessibleError = tr("Sync error: ");
108-
accessibleError.append(error);
107+
QString accessibleError = tr("Sync error: %1").arg(error);
109108
errorItem->setData(accessibleError, Qt::AccessibleTextRole);
110109

111110
QStandardItem *emptyEditorItem = new QStandardItem();

0 commit comments

Comments
 (0)