Skip to content

Commit 7074278

Browse files
Merge #6885: fix: improve governance/proposal dialog strings
af85608 fix: improve governance/proposal dialog strings (UdjinM6) Pull request description: ## Issue being fixed or feature implemented - make strings easier to translate - stop translating non-translatable strings - use `%n` where possible ## What was done? ## How Has This Been Tested? ## Breaking Changes n/a ## Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ Top commit has no ACKs. Tree-SHA512: bba2247fc64f152656972d7e30c12eea6d892a622751c8e798a0ccb522c297356b1ae3964d9db25aa1c920eb71d862e026b0a490ddce784563aea9caa5445425
2 parents 3075924 + af85608 commit 7074278

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

src/qt/forms/proposalwizard.ui

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
</sizepolicy>
111111
</property>
112112
<property name="placeholderText">
113-
<string>short-unique-name</string>
113+
<string notr="true">short-unique-name</string>
114114
</property>
115115
<property name="maximumHeight">
116116
<number>24</number>
@@ -136,7 +136,7 @@
136136
</sizepolicy>
137137
</property>
138138
<property name="placeholderText">
139-
<string>https://example.com/my-proposal</string>
139+
<string notr="true">https://example.com/my-proposal</string>
140140
</property>
141141
<property name="maximumHeight">
142142
<number>24</number>
@@ -255,7 +255,7 @@
255255
<item row="6" column="1">
256256
<widget class="QLabel" name="labelTotalValue">
257257
<property name="text">
258-
<string>0</string>
258+
<string notr="true">0</string>
259259
</property>
260260
</widget>
261261
</item>
@@ -342,7 +342,7 @@
342342
<item>
343343
<widget class="QLabel" name="labelValidateStatus">
344344
<property name="text">
345-
<string>-</string>
345+
<string notr="true">-</string>
346346
</property>
347347
</widget>
348348
</item>
@@ -427,7 +427,7 @@
427427
<item>
428428
<widget class="QLabel" name="labelTxidCaption">
429429
<property name="text">
430-
<string>TxID:</string>
430+
<string notr="true">TxID:</string>
431431
</property>
432432
</widget>
433433
</item>
@@ -437,7 +437,7 @@
437437
<bool>true</bool>
438438
</property>
439439
<property name="placeholderText">
440-
<string>-</string>
440+
<string notr="true">-</string>
441441
</property>
442442
<property name="maximumHeight">
443443
<number>24</number>
@@ -661,7 +661,7 @@
661661
<bool>true</bool>
662662
</property>
663663
<property name="placeholderText">
664-
<string>-</string>
664+
<string notr="true">-</string>
665665
</property>
666666
<property name="maximumHeight">
667667
<number>24</number>

src/qt/governancelist.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -595,18 +595,17 @@ void GovernanceList::voteForProposal(vote_outcome_enum_t outcome)
595595

596596
// Show results
597597
QString message;
598-
if (nSuccessful > 0 && nFailed == 0) {
599-
message = tr("Voted successfully %1 time(s).").arg(nSuccessful);
600-
} else if (nSuccessful > 0 && nFailed > 0) {
601-
message = tr("Voted successfully %1 time(s) and failed %2 time(s).").arg(nSuccessful).arg(nFailed);
602-
if (!failedMessages.isEmpty()) {
603-
message += tr("\n\nFailed votes:\n%1").arg(failedMessages.join("\n"));
604-
}
605-
} else {
606-
message = tr("Failed to vote %1 time(s).").arg(nFailed);
607-
if (!failedMessages.isEmpty()) {
608-
message += tr("\n\nErrors:\n%1").arg(failedMessages.join("\n"));
598+
if (nSuccessful > 0) {
599+
message += tr("Voted successfully %n time(s)", "", nSuccessful);
600+
}
601+
if (nFailed > 0) {
602+
if (nSuccessful > 0) {
603+
message += QString("\n");
609604
}
605+
message += tr("Failed to vote %n time(s)", "", nFailed);
606+
}
607+
if (!failedMessages.isEmpty()) {
608+
message += QString("\n\n") + tr("Errors:") + QString("\n") + failedMessages.join("\n");
610609
}
611610

612611
QMessageBox::information(this, tr("Voting Results"), message);

src/qt/proposalwizard.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ProposalWizard::ProposalWizard(interfaces::Node& node, WalletModel* walletModel,
6060
// Initialize fields
6161
// Populate payments dropdown (mainnet 1..12 by default; adjust by network later if needed)
6262
for (int i = 1; i <= 12; ++i) {
63-
m_ui->comboPayments->addItem(tr("%1").arg(i), i);
63+
m_ui->comboPayments->addItem(QString().setNum(i), i);
6464
}
6565
m_ui->comboPayments->setCurrentIndex(0);
6666

@@ -290,8 +290,8 @@ void ProposalWizard::onMaybeAdvanceAfterConfirmations()
290290
if (m_confirmTimer) m_confirmTimer->stop();
291291
} else {
292292
const auto mins = (secs + 59) / 60;
293-
m_ui->labelEta->setText(tr("Estimated time remaining: %1 min").arg(mins));
294-
m_ui->labelEta2->setText(tr("Estimated time remaining: %1 min").arg(mins));
293+
m_ui->labelEta->setText(tr("Estimated time remaining: %n minute(s)", "", mins));
294+
m_ui->labelEta2->setText(tr("Estimated time remaining: %n minute(s)", "", mins));
295295
}
296296
}
297297
// Allow submitting (relay/postpone) at 1 confirmation and enable Next to proceed
@@ -321,7 +321,8 @@ void ProposalWizard::onSubmit()
321321
const QString govId = QString::fromStdString(obj_hash);
322322
m_ui->editGovObjId->setText(govId);
323323
QMessageBox::information(this, tr("Proposal submitted"),
324-
tr("Your proposal was submitted successfully.\nID: %1").arg(govId));
324+
tr("Your proposal was submitted successfully.") +
325+
QString("\nID: %1").arg(govId));
325326
m_submitted = true;
326327
m_ui->btnSubmit->setEnabled(false);
327328
// When 6 confs are reached show a final success message

0 commit comments

Comments
 (0)