The default format QDateTime::toString uses isn't very good
Also make it possible for translators to change the format
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());
- displayMsg(e, Message::Server, tr("[Whois] %1 is logged in since %2").arg(e->params()[0], loginTime.toString()));
+ //: 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));
+ //: 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"));
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), e->timestamp().toLocalTime().addSecs(-idleSecs).toString()));
+ .arg(e->params()[0], secondsToString(idleSecs), idlingSince));
return;
}
QDateTime time = QDateTime::fromTime_t(unixtime);
return;
}
QDateTime time = QDateTime::fromTime_t(unixtime);
- displayMsg(e, Message::Topic, tr("Channel %1 created on %2").arg(channel, time.toString()), QString(), channel);
+ //: 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);
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"));
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], QDateTime::fromTime_t(e->params()[2].toInt()).toString()), QString(), channel);
+ .arg(e->params()[1], topicSetTime), QString(), channel);
//: Error Message
t = tr("%1").arg(txt); break;
case Message::DayChange:
//: Error Message
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(timestamp().toString());
+ t = tr("{Day changed to %1}").arg(newDate);
+ }
break;
case Message::Topic:
//: Topic Message
break;
case Message::Topic:
//: Topic Message