Skip to content

Commit 294a018

Browse files
committed
qt: Avoid error prone leading spaces in translatable strings
1 parent d8298e7 commit 294a018

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/qt/psbtoperationsdialog.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,13 @@ void PSBTOperationsDialog::updateTransactionDisplay() {
174174
QString PSBTOperationsDialog::renderTransaction(const PartiallySignedTransaction &psbtx)
175175
{
176176
QString tx_description;
177+
QLatin1String bullet_point(" * ");
177178
CAmount totalAmount = 0;
178179
for (const CTxOut& out : psbtx.tx->vout) {
179180
CTxDestination address;
180181
ExtractDestination(out.scriptPubKey, address);
181182
totalAmount += out.nValue;
182-
tx_description.append(tr(" * Sends %1 to %2")
183+
tx_description.append(bullet_point).append(tr("Sends %1 to %2")
183184
.arg(BitcoinUnits::formatWithUnit(BitcoinUnit::BTC, out.nValue))
184185
.arg(QString::fromStdString(EncodeDestination(address))));
185186
// Check if the address is one of ours
@@ -188,7 +189,7 @@ QString PSBTOperationsDialog::renderTransaction(const PartiallySignedTransaction
188189
}
189190

190191
PSBTAnalysis analysis = AnalyzePSBT(psbtx);
191-
tx_description.append(" * ");
192+
tx_description.append(bullet_point);
192193
if (!*analysis.fee) {
193194
// This happens if the transaction is missing input UTXO information.
194195
tx_description.append(tr("Unable to calculate transaction fee or total transaction amount."));

src/qt/sendcoinsdialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
302302
// generate amount string with wallet name in case of multiwallet
303303
QString amount = BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount);
304304
if (model->isMultiwallet()) {
305-
amount.append(tr(" from wallet '%1'").arg(GUIUtil::HtmlEscape(model->getWalletName())));
305+
amount = tr("%1 from wallet '%2'").arg(amount, GUIUtil::HtmlEscape(model->getWalletName()));
306306
}
307307

308308
// generate address string

src/qt/transactiondesc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall
323323
if (!GetPaymentRequestMerchant(r.second, merchant)) {
324324
merchant.clear();
325325
} else {
326-
merchant += tr(" (Certificate was not verified)");
326+
merchant = tr("%1 (Certificate was not verified)").arg(merchant);
327327
}
328328
if (!merchant.isNull()) {
329329
strHTML += "<b>" + tr("Merchant") + ":</b> " + GUIUtil::HtmlEscape(merchant) + "<br>";

src/qt/walletcontroller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,10 @@ void MigrateWalletActivity::migrate(WalletModel* wallet_model)
472472
if (res) {
473473
m_success_message = tr("The wallet '%1' was migrated successfully.").arg(GUIUtil::HtmlEscape(res->wallet->getWalletName()));
474474
if (res->watchonly_wallet_name) {
475-
m_success_message += tr(" Watchonly scripts have been migrated to a new wallet named '%1'.").arg(GUIUtil::HtmlEscape(res->watchonly_wallet_name.value()));
475+
m_success_message += QChar(' ') + tr("Watchonly scripts have been migrated to a new wallet named '%1'.").arg(GUIUtil::HtmlEscape(res->watchonly_wallet_name.value()));
476476
}
477477
if (res->solvables_wallet_name) {
478-
m_success_message += tr(" Solvable but not watched scripts have been migrated to a new wallet named '%1'.").arg(GUIUtil::HtmlEscape(res->solvables_wallet_name.value()));
478+
m_success_message += QChar(' ') + tr("Solvable but not watched scripts have been migrated to a new wallet named '%1'.").arg(GUIUtil::HtmlEscape(res->solvables_wallet_name.value()));
479479
}
480480
m_wallet_model = m_wallet_controller->getOrCreateWallet(std::move(res->wallet));
481481
} else {

0 commit comments

Comments
 (0)