ActivityWidget: Handle plural properly in translations.

Even for the case where the number is fixed.
Also fix the translators comments.
This commit is contained in:
Klaas Freitag 2016-03-29 17:18:53 +02:00
parent 8166c52f4a
commit 885f8b382f
2 changed files with 9 additions and 9 deletions

View file

@ -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());

View file

@ -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 );