mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix: Call 'tr' in place, where text is accessible
This commit is contained in:
parent
8e13d96aa6
commit
15d72a9610
|
@ -72,12 +72,6 @@ const QString ChatForm::ACTION_PREFIX = QStringLiteral("/me ");
|
|||
|
||||
namespace
|
||||
{
|
||||
QString statusToString(const Status status)
|
||||
{
|
||||
QString result;
|
||||
return ChatForm::tr(Widget::getStatusTitle(status).toLatin1().data(), "contact status");
|
||||
}
|
||||
|
||||
QString secondsToDHMS(quint32 duration)
|
||||
{
|
||||
QString res;
|
||||
|
@ -635,7 +629,7 @@ void ChatForm::onFriendStatusChanged(uint32_t friendId, Status status)
|
|||
updateCallButtons();
|
||||
|
||||
if (Settings::getInstance().getStatusChangeNotificationEnabled()) {
|
||||
QString fStatus = statusToString(status);
|
||||
QString fStatus = Widget::getStatusTitle(status);
|
||||
addSystemInfoMessage(tr("%1 is now %2", "e.g. \"Dubslow is now online\"")
|
||||
.arg(f->getDisplayedName())
|
||||
.arg(fStatus),
|
||||
|
|
|
@ -2266,15 +2266,15 @@ QString Widget::getStatusTitle(Status status)
|
|||
{
|
||||
switch (status) {
|
||||
case Status::Online:
|
||||
return QStringLiteral("online");
|
||||
return tr("online", "contact status");
|
||||
case Status::Away:
|
||||
return QStringLiteral("away");
|
||||
return tr("away", "contact status");
|
||||
case Status::Busy:
|
||||
return QStringLiteral("busy");
|
||||
return tr("busy", "contact status");
|
||||
case Status::Offline:
|
||||
return QStringLiteral("offline");
|
||||
return tr("offline", "contact status");
|
||||
case Status::Blocked:
|
||||
return QStringLiteral("blocked");
|
||||
return tr("blocked", "contact status");
|
||||
}
|
||||
|
||||
assert(false);
|
||||
|
|
Loading…
Reference in New Issue
Block a user