Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate unit names & fix external signer error #599

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions src/qt/bitcoinunits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,44 @@ QList<BitcoinUnit> BitcoinUnits::availableUnits()
QString BitcoinUnits::longName(Unit unit)
{
switch (unit) {
case Unit::BTC: return QString("BTC");
case Unit::mBTC: return QString("mBTC");
case Unit::uBTC: return QString::fromUtf8("µBTC (bits)");
case Unit::SAT: return QString("Satoshi (sat)");
//: "BTC" as a unit name in dropbox selector
case Unit::BTC: return tr("BTC", "long unit name");
//: "mBTC" as a unit name in dropbox selector
case Unit::mBTC: return tr("mBTC", "long unit name");
//: "µBTC" as a unit name in dropbox selector
case Unit::uBTC: return tr("µBTC (bits)", "long unit name");
//: Base unit name in dropbox selector
case Unit::SAT: return tr("Satoshi (sat)", "long unit name");
} // no default case, so the compiler can warn about missing cases
assert(false);
}

QString BitcoinUnits::shortName(Unit unit)
{
switch (unit) {
case Unit::BTC: return longName(unit);
case Unit::mBTC: return longName(unit);
case Unit::uBTC: return QString("bits");
case Unit::SAT: return QString("sat");
//: "BTC" as a unit suffix
case Unit::BTC: return tr("BTC", "unit suffix");
//: "mBTC" as a unit suffix
case Unit::mBTC: return tr("mBTC", "unit suffix");
//: "µBTC" as a unit suffix
case Unit::uBTC: return tr("bits", "unit suffix");
//: Base unit suffix
case Unit::SAT: return tr("sat", "unit suffix");
} // no default case, so the compiler can warn about missing cases
assert(false);
}

QString BitcoinUnits::description(Unit unit)
{
switch (unit) {
case Unit::BTC: return QString("Bitcoins");
case Unit::mBTC: return QString("Milli-Bitcoins (1 / 1" THIN_SP_UTF8 "000)");
case Unit::uBTC: return QString("Micro-Bitcoins (bits) (1 / 1" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)");
case Unit::SAT: return QString("Satoshi (sat) (1 / 100" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)");
//: Tooltip description of "BTC" unit in dropbox selector
case Unit::BTC: return tr("Bitcoins", "unit description");
//: Tooltip description of "mBTC" unit in dropbox selector
case Unit::mBTC: return tr("Milli-Bitcoins (1 / 1" THIN_SP_UTF8 "000)", "unit description");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2e55d10

It seems not passing to the translation file properly.

//: Tooltip description of "µBTC" unit in dropbox selector
case Unit::uBTC: return tr("Micro-Bitcoins (bits) (1 / 1" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)", "unit description");
//: Tooltip description of base unit in dropbox selector
case Unit::SAT: return tr("Satoshi (sat) (1 / 100" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)", "unit description");
} // no default case, so the compiler can warn about missing cases
assert(false);
}
Expand Down
3 changes: 2 additions & 1 deletion src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,9 @@ bool SendCoinsDialog::signWithExternalSigner(PartiallySignedTransaction& psbtx,
return false;
}
if (err != TransactionError::OK) {
tfm::format(std::cerr, "Failed to sign PSBT");
processSendCoinsReturn(WalletModel::TransactionCreationFailed);
const QString msg = tr("Failed to sign PSBT");
QMessageBox::critical(nullptr, msg, msg);
return false;
}
// fillPSBT does not always properly finalize
Expand Down