Reverts configuration of timestamp formats via translation files.
Formatting of timestamps and such should completely move from core to client at
some point.
Fixes #1199
if (e->params().count() > 3) { // if we have more then 3 params we have the above mentioned "real life" situation
QDateTime loginTime = QDateTime::fromTime_t(e->params()[2].toInt());
if (e->params().count() > 3) { // if we have more then 3 params we have the above mentioned "real life" situation
QDateTime loginTime = QDateTime::fromTime_t(e->params()[2].toInt());
- //: Time format. See http://qt-project.org/doc/qt-4.8/qdatetime.html#toString
- QString formattedLoginTime = loginTime.toString(tr("MMMM d yyyy hh:mm"));
- displayMsg(e, Message::Server, tr("[Whois] %1 is logged in since %2").arg(e->params()[0], formattedLoginTime));
+ displayMsg(e, Message::Server, tr("[Whois] %1 is logged in since %2")
+ .arg(e->params()[0], QLocale().toString(loginTime, QLocale().dateTimeFormat())));
- //: Time format. See http://qt-project.org/doc/qt-4.8/qdatetime.html#toString
- QString idlingSince = e->timestamp().toLocalTime().addSecs(-idleSecs).toString(tr("MMMM d yyyy hh:mm"));
+ QDateTime idlingSince = e->timestamp().toLocalTime().addSecs(-idleSecs);
displayMsg(e, Message::Server, tr("[Whois] %1 is idling for %2 (since %3)")
displayMsg(e, Message::Server, tr("[Whois] %1 is idling for %2 (since %3)")
- .arg(e->params()[0], secondsToString(idleSecs), idlingSince));
+ .arg(e->params()[0], secondsToString(idleSecs),
+ QLocale().toString(idlingSince, QLocale().dateTimeFormat())));
return;
}
QDateTime time = QDateTime::fromTime_t(unixtime);
return;
}
QDateTime time = QDateTime::fromTime_t(unixtime);
- //: Time format. See http://qt-project.org/doc/qt-4.8/qdatetime.html#toString
- QString formattedTime = time.toString(tr("MMMM d yyyy hh:mm"));
- displayMsg(e, Message::Topic, tr("Channel %1 created on %2").arg(channel, formattedTime), QString(), channel);
+ displayMsg(e, Message::Topic, tr("Channel %1 created on %2")
+ .arg(channel, QLocale().toString(time, QLocale().dateTimeFormat())),
+ QString(), channel);
return;
QString channel = e->params().first();
return;
QString channel = e->params().first();
- //: Time format. See http://qt-project.org/doc/qt-4.8/qdatetime.html#toString
- QString topicSetTime = QDateTime::fromTime_t(e->params()[2].toInt()).toString(tr("MMMM d yyyy hh:mm"));
+ QDateTime topicSetTime = QDateTime::fromTime_t(e->params()[2].toInt());
displayMsg(e, Message::Topic, tr("Topic set by %1 on %2")
displayMsg(e, Message::Topic, tr("Topic set by %1 on %2")
- .arg(e->params()[1], topicSetTime), QString(), channel);
+ .arg(e->params()[1],
+ QLocale().toString(topicSetTime, QLocale().dateTimeFormat()), QString(), channel));
t = tr("%1").arg(txt); break;
case Message::DayChange:
{
t = tr("%1").arg(txt); break;
case Message::DayChange:
{
- //: Date format. See http://qt-project.org/doc/qt-4.8/qdate.html#toString
- QString newDate = timestamp().toString(tr("MMMM d yyyy"));
- t = tr("{Day changed to %1}").arg(newDate);
+ t = tr("{Day changed to %1}").arg(QLocale().toString(timestamp(), QLocale().dateFormat()));
}
break;
case Message::Topic:
}
break;
case Message::Topic: