mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
qt: connection type translator comments
Introduce Qt translator comments for connection types.
This commit is contained in:
parent
5c041cb348
commit
4832737c7d
2 changed files with 27 additions and 1 deletions
|
@ -671,14 +671,26 @@ QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction
|
||||||
{
|
{
|
||||||
QString prefix;
|
QString prefix;
|
||||||
if (prepend_direction) {
|
if (prepend_direction) {
|
||||||
prefix = (conn_type == ConnectionType::INBOUND) ? QObject::tr("Inbound") : QObject::tr("Outbound") + " ";
|
prefix = (conn_type == ConnectionType::INBOUND) ?
|
||||||
|
/*: An inbound connection from a peer. An inbound connection
|
||||||
|
is a connection initiated by a peer. */
|
||||||
|
QObject::tr("Inbound") :
|
||||||
|
/*: An outbound connection to a peer. An outbound connection
|
||||||
|
is a connection initiated by us. */
|
||||||
|
QObject::tr("Outbound") + " ";
|
||||||
}
|
}
|
||||||
switch (conn_type) {
|
switch (conn_type) {
|
||||||
case ConnectionType::INBOUND: return prefix;
|
case ConnectionType::INBOUND: return prefix;
|
||||||
|
//: Peer connection type that relays all network information.
|
||||||
case ConnectionType::OUTBOUND_FULL_RELAY: return prefix + QObject::tr("Full Relay");
|
case ConnectionType::OUTBOUND_FULL_RELAY: return prefix + QObject::tr("Full Relay");
|
||||||
|
/*: Peer connection type that relays network information about
|
||||||
|
blocks and not transactions or addresses. */
|
||||||
case ConnectionType::BLOCK_RELAY: return prefix + QObject::tr("Block Relay");
|
case ConnectionType::BLOCK_RELAY: return prefix + QObject::tr("Block Relay");
|
||||||
|
//: Peer connection type established manually through one of several methods.
|
||||||
case ConnectionType::MANUAL: return prefix + QObject::tr("Manual");
|
case ConnectionType::MANUAL: return prefix + QObject::tr("Manual");
|
||||||
|
//: Short-lived peer connection type that tests the aliveness of known addresses.
|
||||||
case ConnectionType::FEELER: return prefix + QObject::tr("Feeler");
|
case ConnectionType::FEELER: return prefix + QObject::tr("Feeler");
|
||||||
|
//: Short-lived peer connection type that solicits known addresses from a peer.
|
||||||
case ConnectionType::ADDR_FETCH: return prefix + QObject::tr("Address Fetch");
|
case ConnectionType::ADDR_FETCH: return prefix + QObject::tr("Address Fetch");
|
||||||
} // no default case, so the compiler can warn about missing cases
|
} // no default case, so the compiler can warn about missing cases
|
||||||
assert(false);
|
assert(false);
|
||||||
|
|
|
@ -471,14 +471,28 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
|
||||||
|
|
||||||
constexpr QChar nonbreaking_hyphen(8209);
|
constexpr QChar nonbreaking_hyphen(8209);
|
||||||
const std::vector<QString> CONNECTION_TYPE_DOC{
|
const std::vector<QString> CONNECTION_TYPE_DOC{
|
||||||
|
//: Explanatory text for an inbound peer connection.
|
||||||
tr("Inbound: initiated by peer"),
|
tr("Inbound: initiated by peer"),
|
||||||
|
/*: Explanatory text for an outbound peer connection that
|
||||||
|
relays all network information. This is the default behavior for
|
||||||
|
outbound connections. */
|
||||||
tr("Outbound Full Relay: default"),
|
tr("Outbound Full Relay: default"),
|
||||||
|
/*: Explanatory text for an outbound peer connection that relays
|
||||||
|
network information about blocks and not transactions or addresses. */
|
||||||
tr("Outbound Block Relay: does not relay transactions or addresses"),
|
tr("Outbound Block Relay: does not relay transactions or addresses"),
|
||||||
|
/*: Explanatory text for an outbound peer connection that was
|
||||||
|
established manually through one of several methods. The numbered
|
||||||
|
arguments are stand-ins for the methods available to establish
|
||||||
|
manual connections. */
|
||||||
tr("Outbound Manual: added using RPC %1 or %2/%3 configuration options")
|
tr("Outbound Manual: added using RPC %1 or %2/%3 configuration options")
|
||||||
.arg("addnode")
|
.arg("addnode")
|
||||||
.arg(QString(nonbreaking_hyphen) + "addnode")
|
.arg(QString(nonbreaking_hyphen) + "addnode")
|
||||||
.arg(QString(nonbreaking_hyphen) + "connect"),
|
.arg(QString(nonbreaking_hyphen) + "connect"),
|
||||||
|
/*: Explanatory text for a short-lived outbound peer connection that
|
||||||
|
is used to test the aliveness of known addresses. */
|
||||||
tr("Outbound Feeler: short-lived, for testing addresses"),
|
tr("Outbound Feeler: short-lived, for testing addresses"),
|
||||||
|
/*: Explanatory text for a short-lived outbound peer connection that is used
|
||||||
|
to request addresses from a peer. */
|
||||||
tr("Outbound Address Fetch: short-lived, for soliciting addresses")};
|
tr("Outbound Address Fetch: short-lived, for soliciting addresses")};
|
||||||
const QString list{"<ul><li>" + Join(CONNECTION_TYPE_DOC, QString("</li><li>")) + "</li></ul>"};
|
const QString list{"<ul><li>" + Join(CONNECTION_TYPE_DOC, QString("</li><li>")) + "</li></ul>"};
|
||||||
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list));
|
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list));
|
||||||
|
|
Loading…
Add table
Reference in a new issue