From d04ebdaab74493bb0cba79fbb81b8225e8bbb8de Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sun, 25 Apr 2021 15:34:29 +0200 Subject: [PATCH] gui: improve connection type translations and translator comments --- src/qt/guiutil.cpp | 2 ++ src/qt/rpcconsole.cpp | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index d10bf9f9aeb..d498f271d3e 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -666,10 +666,12 @@ QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction { QString prefix; if (prepend_direction) { + //: Connection direction. Also used in CONNECTION_TYPE_DOC and PeerTableModel::data(). prefix = (conn_type == ConnectionType::INBOUND) ? QObject::tr("Inbound") : QObject::tr("Outbound") + " "; } switch (conn_type) { case ConnectionType::INBOUND: return prefix; + //: The connection types (Full Relay, Block Relay, Manual, Feeler, Address Fetch) are also used in CONNECTION_TYPE_DOC. case ConnectionType::OUTBOUND_FULL_RELAY: return prefix + QObject::tr("Full Relay"); case ConnectionType::BLOCK_RELAY: return prefix + QObject::tr("Block Relay"); case ConnectionType::MANUAL: return prefix + QObject::tr("Manual"); diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 85412ca75bb..946254daff0 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -462,15 +462,17 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty constexpr QChar nonbreaking_hyphen(8209); const std::vector CONNECTION_TYPE_DOC{ - tr("Inbound: initiated by peer"), - tr("Outbound Full Relay: default"), - tr("Outbound Block Relay: does not relay transactions or addresses"), - tr("Outbound Manual: added using RPC %1 or %2/%3 configuration options") + //: The connection direction (Inbound/Outbound) is also used in ConnectionTypeToQString() and PeerTableModel::data(). + //: The connection types (Full Relay, Block Relay, Manual, Feeler, Address Fetch) are also used in ConnectionTypeToQString(). + tr("Inbound") + ": " + tr("initiated by peer"), + tr("Outbound") + " " + tr("Full Relay") + ": " + tr("default"), + tr("Outbound") + " " + tr("Block Relay") + ": " + tr("does not relay transactions or addresses"), + tr("Outbound") + " " + tr("Manual") + ": " + tr("added using RPC %1 or %2/%3 configuration options") .arg("addnode") .arg(QString(nonbreaking_hyphen) + "addnode") .arg(QString(nonbreaking_hyphen) + "connect"), - tr("Outbound Feeler: short-lived, for testing addresses"), - tr("Outbound Address Fetch: short-lived, for soliciting addresses")}; + tr("Outbound") + " " + tr("Feeler") + ": " + tr("short-lived, for testing addresses"), + tr("Outbound") + " " + tr("Address Fetch") + ": " + tr("short-lived, for soliciting addresses")}; const QString list{""}; ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list)); const QString hb_list{"