Skip to content

Commit

Permalink
ActivityWidget: Handle plural properly in translations.
Browse files Browse the repository at this point in the history
Even for the case where the number is fixed.
Also fix the translators comments.
  • Loading branch information
dragotin committed Mar 29, 2016
1 parent 8166c52 commit 885f8b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/gui/activitywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,18 +340,18 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList& list)
QString acc2 = accNotified.keys().at(1);
if( newGuiLogCount == 2 ) {
int notiCount = accNotified[ acc1 ] + accNotified[ acc2 ];
msg = tr("You received %1 new notifications from %2 and %3.").arg(notiCount).arg(acc1).arg(acc2);
msg = tr("You received %n new notification(s) from %1 and %2.", "", notiCount).arg(acc1, acc2);
} else {
msg = tr("You received new notifications from %1, %2 and other accounts.").arg(acc1).arg(acc2);
msg = tr("You received new notifications from %1, %2 and other accounts.").arg(acc1, acc2);
}
}

emit guiLog(Theme::instance()->appNameGUI() + QLatin1String(" ") + tr("Notifications - Action Required"),
msg);
const QString log = tr("%1 Notifications - Action Required").arg(Theme::instance()->appNameGUI());
emit guiLog( log, msg);
}
}

void ActivityWidget::slotSendNotificationRequest(const QString& accountName, const QString& link, const QString& verb)
void ActivityWidget::slotSendNotificationRequest(const QString& accountName, const QString& link, const QByteArray& verb)
{
qDebug() << Q_FUNC_INFO << "Server Notification Request " << verb << link << "on account" << accountName;
NotificationWidget *theSender = qobject_cast<NotificationWidget*>(sender());
Expand Down
8 changes: 4 additions & 4 deletions src/gui/notificationwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ void NotificationWidget::slotNotificationRequestFinished(int statusCode)
for( i = 0; i < _buttons.count(); i++ ) {
_buttons.at(i)->setEnabled(true);
}
//* The second parameter is a time, such as 'failed at 09:58pm'
doneText = tr("%1 request failed at %2").arg(_actionLabel).arg(timeStr);
//: The second parameter is a time, such as 'failed at 09:58pm'
doneText = tr("%1 request failed at %2").arg(_actionLabel, timeStr);
} else {
// the call to the ocs API succeeded.
_ui._buttonBox->hide();

//* The second parameter is a time, such as 'selected at 09:58pm'
doneText = tr("'%1' selected at %2").arg(_actionLabel).arg(timeStr);
//: The second parameter is a time, such as 'selected at 09:58pm'
doneText = tr("'%1' selected at %2").arg(_actionLabel, timeStr);
}
_ui._timeLabel->setText( doneText );

Expand Down

0 comments on commit 885f8b3

Please sign in to comment.