qt: Avoid error prone leading spaces in translatable strings

This commit is contained in:
Hennadii Stepanov
2023-10-23 15:06:42 +01:00
parent d8298e7f06
commit 294a018bf5
4 changed files with 7 additions and 6 deletions

View File

@@ -174,12 +174,13 @@ void PSBTOperationsDialog::updateTransactionDisplay() {
QString PSBTOperationsDialog::renderTransaction(const PartiallySignedTransaction &psbtx)
{
QString tx_description;
QLatin1String bullet_point(" * ");
CAmount totalAmount = 0;
for (const CTxOut& out : psbtx.tx->vout) {
CTxDestination address;
ExtractDestination(out.scriptPubKey, address);
totalAmount += out.nValue;
tx_description.append(tr(" * Sends %1 to %2")
tx_description.append(bullet_point).append(tr("Sends %1 to %2")
.arg(BitcoinUnits::formatWithUnit(BitcoinUnit::BTC, out.nValue))
.arg(QString::fromStdString(EncodeDestination(address))));
// Check if the address is one of ours
@@ -188,7 +189,7 @@ QString PSBTOperationsDialog::renderTransaction(const PartiallySignedTransaction
}
PSBTAnalysis analysis = AnalyzePSBT(psbtx);
tx_description.append(" * ");
tx_description.append(bullet_point);
if (!*analysis.fee) {
// This happens if the transaction is missing input UTXO information.
tx_description.append(tr("Unable to calculate transaction fee or total transaction amount."));