mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-08-04 05:54:48 +02:00
qt: Avoid error prone leading spaces in translatable strings
This commit is contained in:
parent
d8298e7f06
commit
294a018bf5
@ -174,12 +174,13 @@ void PSBTOperationsDialog::updateTransactionDisplay() {
|
|||||||
QString PSBTOperationsDialog::renderTransaction(const PartiallySignedTransaction &psbtx)
|
QString PSBTOperationsDialog::renderTransaction(const PartiallySignedTransaction &psbtx)
|
||||||
{
|
{
|
||||||
QString tx_description;
|
QString tx_description;
|
||||||
|
QLatin1String bullet_point(" * ");
|
||||||
CAmount totalAmount = 0;
|
CAmount totalAmount = 0;
|
||||||
for (const CTxOut& out : psbtx.tx->vout) {
|
for (const CTxOut& out : psbtx.tx->vout) {
|
||||||
CTxDestination address;
|
CTxDestination address;
|
||||||
ExtractDestination(out.scriptPubKey, address);
|
ExtractDestination(out.scriptPubKey, address);
|
||||||
totalAmount += out.nValue;
|
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(BitcoinUnits::formatWithUnit(BitcoinUnit::BTC, out.nValue))
|
||||||
.arg(QString::fromStdString(EncodeDestination(address))));
|
.arg(QString::fromStdString(EncodeDestination(address))));
|
||||||
// Check if the address is one of ours
|
// Check if the address is one of ours
|
||||||
@ -188,7 +189,7 @@ QString PSBTOperationsDialog::renderTransaction(const PartiallySignedTransaction
|
|||||||
}
|
}
|
||||||
|
|
||||||
PSBTAnalysis analysis = AnalyzePSBT(psbtx);
|
PSBTAnalysis analysis = AnalyzePSBT(psbtx);
|
||||||
tx_description.append(" * ");
|
tx_description.append(bullet_point);
|
||||||
if (!*analysis.fee) {
|
if (!*analysis.fee) {
|
||||||
// This happens if the transaction is missing input UTXO information.
|
// This happens if the transaction is missing input UTXO information.
|
||||||
tx_description.append(tr("Unable to calculate transaction fee or total transaction amount."));
|
tx_description.append(tr("Unable to calculate transaction fee or total transaction amount."));
|
||||||
|
@ -302,7 +302,7 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
|
|||||||
// generate amount string with wallet name in case of multiwallet
|
// generate amount string with wallet name in case of multiwallet
|
||||||
QString amount = BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount);
|
QString amount = BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount);
|
||||||
if (model->isMultiwallet()) {
|
if (model->isMultiwallet()) {
|
||||||
amount.append(tr(" from wallet '%1'").arg(GUIUtil::HtmlEscape(model->getWalletName())));
|
amount = tr("%1 from wallet '%2'").arg(amount, GUIUtil::HtmlEscape(model->getWalletName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate address string
|
// generate address string
|
||||||
|
@ -323,7 +323,7 @@ QString TransactionDesc::toHTML(interfaces::Node& node, interfaces::Wallet& wall
|
|||||||
if (!GetPaymentRequestMerchant(r.second, merchant)) {
|
if (!GetPaymentRequestMerchant(r.second, merchant)) {
|
||||||
merchant.clear();
|
merchant.clear();
|
||||||
} else {
|
} else {
|
||||||
merchant += tr(" (Certificate was not verified)");
|
merchant = tr("%1 (Certificate was not verified)").arg(merchant);
|
||||||
}
|
}
|
||||||
if (!merchant.isNull()) {
|
if (!merchant.isNull()) {
|
||||||
strHTML += "<b>" + tr("Merchant") + ":</b> " + GUIUtil::HtmlEscape(merchant) + "<br>";
|
strHTML += "<b>" + tr("Merchant") + ":</b> " + GUIUtil::HtmlEscape(merchant) + "<br>";
|
||||||
|
@ -472,10 +472,10 @@ void MigrateWalletActivity::migrate(WalletModel* wallet_model)
|
|||||||
if (res) {
|
if (res) {
|
||||||
m_success_message = tr("The wallet '%1' was migrated successfully.").arg(GUIUtil::HtmlEscape(res->wallet->getWalletName()));
|
m_success_message = tr("The wallet '%1' was migrated successfully.").arg(GUIUtil::HtmlEscape(res->wallet->getWalletName()));
|
||||||
if (res->watchonly_wallet_name) {
|
if (res->watchonly_wallet_name) {
|
||||||
m_success_message += tr(" Watchonly scripts have been migrated to a new wallet named '%1'.").arg(GUIUtil::HtmlEscape(res->watchonly_wallet_name.value()));
|
m_success_message += QChar(' ') + tr("Watchonly scripts have been migrated to a new wallet named '%1'.").arg(GUIUtil::HtmlEscape(res->watchonly_wallet_name.value()));
|
||||||
}
|
}
|
||||||
if (res->solvables_wallet_name) {
|
if (res->solvables_wallet_name) {
|
||||||
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()));
|
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()));
|
||||||
}
|
}
|
||||||
m_wallet_model = m_wallet_controller->getOrCreateWallet(std::move(res->wallet));
|
m_wallet_model = m_wallet_controller->getOrCreateWallet(std::move(res->wallet));
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user