diff options
author | Jan Klass <kissaki@posteo.de> | 2021-03-05 00:48:44 +0300 |
---|---|---|
committer | Jan Klass <kissaki@posteo.de> | 2021-03-05 23:03:00 +0300 |
commit | cdde00db891f77bfe7d60d5298a5a389581ad85c (patch) | |
tree | 44de1d3e7ee88ba2d744f3e2ef83419fa0d5b9d9 /src | |
parent | 95d51828acaffc841cfba0b63a279081babd1008 (diff) |
TRANSLATION: Revert "REFAC(client): Use QObject to access static tr()"
This reverts commit 591741c9a6588107431f68e81f34ad64af65d0fd
which was part of PR #4777.
That change switched `tr` calls from the specific class to being referenced on QObject.
That broke all of the translations we have for these strings.
Qt/tr assigns a translation context, which is the Q_OBJECT context by default. By not calling tr on the specific QObject but the base function, the context is dropped. The strings are now no longer in the ConnectDialog but the generic QObject.
Obviously that is undesired.
Reverting that change is the first step to manually restoring the translations.
They were dropped automatically by updating translations - and the previous strings no longer existing.
Diffstat (limited to 'src')
-rw-r--r-- | src/mumble/ConnectDialog.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/mumble/ConnectDialog.cpp b/src/mumble/ConnectDialog.cpp index b20533946..2f3968a68 100644 --- a/src/mumble/ConnectDialog.cpp +++ b/src/mumble/ConnectDialog.cpp @@ -410,8 +410,8 @@ ServerItem *ServerItem::fromUrl(QUrl url, QWidget *p) { if (g.s.qsUsername.isEmpty()) { bool ok; QString defUserName = - QInputDialog::getText(p, QObject::tr("Adding host %1").arg(url.host()), - QObject::tr("Enter username"), QLineEdit::Normal, g.s.qsUsername, &ok) + QInputDialog::getText(p, ConnectDialog::tr("Adding host %1").arg(url.host()), + ConnectDialog::tr("Enter username"), QLineEdit::Normal, g.s.qsUsername, &ok) .trimmed(); if (!ok) return nullptr; @@ -485,45 +485,45 @@ QVariant ServerItem::data(int column, int role) const { QString qs; qs += QLatin1String("<table>") + QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") - .arg(QObject::tr("Servername"), qsName.toHtmlEscaped()) + .arg(ConnectDialog::tr("Servername"), qsName.toHtmlEscaped()) + QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") - .arg(QObject::tr("Hostname"), qsHostname.toHtmlEscaped()); + .arg(ConnectDialog::tr("Hostname"), qsHostname.toHtmlEscaped()); #ifdef USE_ZEROCONF if (!zeroconfHost.isEmpty()) qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") - .arg(QObject::tr("Bonjour name"), zeroconfHost.toHtmlEscaped()); + .arg(ConnectDialog::tr("Bonjour name"), zeroconfHost.toHtmlEscaped()); #endif qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") - .arg(QObject::tr("Port")) + .arg(ConnectDialog::tr("Port")) .arg(usPort) + QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") - .arg(QObject::tr("Addresses"), qsl.join(QLatin1String(", "))); + .arg(ConnectDialog::tr("Addresses"), qsl.join(QLatin1String(", "))); if (!qsUrl.isEmpty()) qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") - .arg(QObject::tr("Website"), qsUrl.toHtmlEscaped()); + .arg(ConnectDialog::tr("Website"), qsUrl.toHtmlEscaped()); if (uiSent > 0) { qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") - .arg(QObject::tr("Packet loss"), + .arg(ConnectDialog::tr("Packet loss"), QString::fromLatin1("%1% (%2/%3)").arg(ploss, 0, 'f', 1).arg(uiRecv).arg(uiSent)); if (uiRecv > 0) { qs += QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") - .arg(QObject::tr("Ping (80%)"), - QObject::tr("%1 ms").arg( + .arg(ConnectDialog::tr("Ping (80%)"), + ConnectDialog::tr("%1 ms").arg( boost::accumulators::extended_p_square(*asQuantile)[1] / 1000., 0, 'f', 2)) + QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") - .arg(QObject::tr("Ping (95%)"), - QObject::tr("%1 ms").arg( + .arg(ConnectDialog::tr("Ping (95%)"), + ConnectDialog::tr("%1 ms").arg( boost::accumulators::extended_p_square(*asQuantile)[2] / 1000., 0, 'f', 2)) + QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") - .arg(QObject::tr("Bandwidth"), - QObject::tr("%1 kbit/s").arg(uiBandwidth / 1000)) + .arg(ConnectDialog::tr("Bandwidth"), + ConnectDialog::tr("%1 kbit/s").arg(uiBandwidth / 1000)) + QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") - .arg(QObject::tr("Users"), + .arg(ConnectDialog::tr("Users"), QString::fromLatin1("%1/%2").arg(uiUsers).arg(uiMaxUsers)) + QString::fromLatin1("<tr><th align=left>%1</th><td>%2</td></tr>") - .arg(QObject::tr("Version")) + .arg(ConnectDialog::tr("Version")) .arg(MumbleVersion::toString(uiVersion)); } } |