Replace disambiguation strings with translator comments #332

pull hebasto wants to merge 1 commits into bitcoin-core:master from hebasto:210515-trcom changing 7 files +21 −9
  1. hebasto commented at 1:40 pm on May 15, 2021: member

    Since https://github.com/bitcoin/bitcoin/pull/21694 is merged, translator comments is the right way to pass context to translators.

    This PR fixes changes were made:

    Closes #288.

  2. hebasto added the label Translations on May 15, 2021
  3. in src/qt/addressbookpage.cpp:284 in 2b28b00618 outdated
    280@@ -281,7 +281,9 @@ void AddressBookPage::on_exportButton_clicked()
    281     // CSV is currently the only supported format
    282     QString filename = GUIUtil::getSaveFileName(this,
    283         tr("Export Address List"), QString(),
    284-        tr("Comma separated file", "Name of CSV file format") + QLatin1String(" (*.csv)"), nullptr);
    285+        /*: Name of CSV file format.
    


    jarolrod commented at 8:38 pm on May 15, 2021:
    0        /*: Expanded name of the CSV file format.
    

    hebasto commented at 10:10 pm on May 15, 2021:
    Thanks! Updated.
  4. in src/qt/intro.cpp:389 in 2b28b00618 outdated
    384@@ -385,7 +385,9 @@ void Intro::UpdatePruneLabels(bool prune_checked)
    385     static constexpr uint64_t nPowTargetSpacing = 10 * 60;  // from chainparams, which we don't have at this stage
    386     static constexpr uint32_t expected_block_data_size = 2250000;  // includes undo data
    387     const uint64_t expected_backup_days = m_prune_target_gb * 1e9 / (uint64_t(expected_block_data_size) * 86400 / nPowTargetSpacing);
    388-    ui->lblPruneSuffix->setText(tr("(sufficient to restore backups %n day(s) old)", "block chain pruning", expected_backup_days));
    389+    ui->lblPruneSuffix->setText(
    390+        //: A note about a pruned node capability.
    


    jarolrod commented at 8:41 pm on May 15, 2021:
    0        //: Explanatory text on the capability of the current prune target.
    

    hebasto commented at 10:10 pm on May 15, 2021:
    Thanks! Updated.
  5. in src/qt/psbtoperationsdialog.cpp:144 in 2b28b00618 outdated
    140@@ -141,7 +141,8 @@ void PSBTOperationsDialog::saveTransaction() {
    141     filename_suggestion.append(".psbt");
    142     QString filename = GUIUtil::getSaveFileName(this,
    143         tr("Save Transaction Data"), filename_suggestion,
    144-        tr("Partially Signed Transaction (Binary)", "Name of binary PSBT file format") + QLatin1String(" (*.psbt)"), &selected_filter);
    145+        //: Name of binary PSBT file format. See: BIP 174.
    


    jarolrod commented at 8:43 pm on May 15, 2021:
    0        //: Expanded name of the binary PSBT file format. See: BIP 174.
    

    hebasto commented at 10:10 pm on May 15, 2021:
    Thanks! Updated.
  6. in src/qt/qrimagewidget.cpp:121 in 2b28b00618 outdated
    117@@ -118,7 +118,9 @@ void QRImageWidget::saveImage()
    118         return;
    119     QString fn = GUIUtil::getSaveFileName(
    120         this, tr("Save QR Code"), QString(),
    121-        tr("PNG Image", "Name of PNG file format") + QLatin1String(" (*.png)"), nullptr);
    122+        /*: Name of PNG file format.
    


    jarolrod commented at 8:44 pm on May 15, 2021:
    0        /*: Expanded name of the PNG file format.
    

    hebasto commented at 10:10 pm on May 15, 2021:
    Thanks! Updated.
  7. in src/qt/sendcoinsdialog.cpp:435 in 2b28b00618 outdated
    431@@ -432,7 +432,8 @@ void SendCoinsDialog::sendButtonClicked([[maybe_unused]] bool checked)
    432             fileNameSuggestion.append(".psbt");
    433             QString filename = GUIUtil::getSaveFileName(this,
    434                 tr("Save Transaction Data"), fileNameSuggestion,
    435-                tr("Partially Signed Transaction (Binary)", "Name of binary PSBT file format") + QLatin1String(" (*.psbt)"), &selectedFilter);
    436+                //: Name of binary PSBT file format. See: BIP 174.
    


    jarolrod commented at 8:45 pm on May 15, 2021:
    0                //: Expanded name of the binary PSBT file format. See: BIP 174.
    

    hebasto commented at 10:10 pm on May 15, 2021:
    Thanks! Updated.
  8. in src/qt/transactionview.cpp:339 in 2b28b00618 outdated
    335@@ -336,7 +336,9 @@ void TransactionView::exportClicked()
    336     // CSV is currently the only supported format
    337     QString filename = GUIUtil::getSaveFileName(this,
    338         tr("Export Transaction History"), QString(),
    339-        tr("Comma separated file", "Name of CSV file format") + QLatin1String(" (*.csv)"), nullptr);
    340+        /*: Name of CSV file format.
    


    jarolrod commented at 8:45 pm on May 15, 2021:
    0        /*: Expanded name of the CSV file format.
    

    hebasto commented at 10:10 pm on May 15, 2021:
    Thanks! Updated.
  9. in src/qt/addressbookpage.cpp:300 in 2b28b00618 outdated
    296@@ -295,8 +297,9 @@ void AddressBookPage::on_exportButton_clicked()
    297 
    298     if(!writer.write()) {
    299         QMessageBox::critical(this, tr("Exporting Failed"),
    300-            //: %1 is a name of the file (e.g., "addrbook.csv") that the bitcoin addresses were exported to.
    301-            tr("There was an error trying to save the address list to %1. Please try again.", "An error message.").arg(filename));
    302+            /*: An error message. %1 is a name of the file (e.g., "addrbook.csv")
    


    jarolrod commented at 8:46 pm on May 15, 2021:
    0            /*: An error message. %1 is a stand-in argument for the name of the file 
    

    hebasto commented at 10:11 pm on May 15, 2021:
  10. in src/qt/addressbookpage.cpp:301 in 2b28b00618 outdated
    296@@ -295,8 +297,9 @@ void AddressBookPage::on_exportButton_clicked()
    297 
    298     if(!writer.write()) {
    299         QMessageBox::critical(this, tr("Exporting Failed"),
    300-            //: %1 is a name of the file (e.g., "addrbook.csv") that the bitcoin addresses were exported to.
    301-            tr("There was an error trying to save the address list to %1. Please try again.", "An error message.").arg(filename));
    302+            /*: An error message. %1 is a name of the file (e.g., "addrbook.csv")
    303+                that the bitcoin addresses were exported to. */
    


    jarolrod commented at 8:47 pm on May 15, 2021:
    0                we attempted to export to. */
    

    hebasto commented at 10:11 pm on May 15, 2021:
  11. jarolrod commented at 8:47 pm on May 15, 2021: member
    Concept ACK
  12. qt: Replace disambiguation strings with translator comments
    Translator comments is the right way to pass context to translators.
    8b77133651
  13. hebasto force-pushed on May 15, 2021
  14. hebasto commented at 10:09 pm on May 15, 2021: member

    Updated 2b28b0061823162a14c29debaaaf0312bcaa12b3 -> 8b7713365134022475e7e5d24d3ca73149bd10e1 (pr332.01 -> pr332.02, diff):

  15. in src/qt/addressbookpage.cpp:284 in 8b77133651
    280@@ -281,7 +281,9 @@ void AddressBookPage::on_exportButton_clicked()
    281     // CSV is currently the only supported format
    282     QString filename = GUIUtil::getSaveFileName(this,
    283         tr("Export Address List"), QString(),
    284-        tr("Comma separated file", "Name of CSV file format") + QLatin1String(" (*.csv)"), nullptr);
    285+        /*: Expanded name of the CSV file format.
    


    jarolrod commented at 0:40 am on May 16, 2021:
    How do we avoid having to translate this twice, same with PSBT?

    hebasto commented at 4:07 am on May 16, 2021:
    We could avoid code duplication by making constants. But not sure if it worth.
  16. jarolrod commented at 4:38 pm on May 16, 2021: member

    ACK 8b7713365134022475e7e5d24d3ca73149bd10e1

    From the top of the repo, I grepped with:

    0grep -rn "tr(\".*\", \".*\".*)" *
    

    manually filtering out the shortlist of results, I end up with the same occurrences being addressed here:

    0src/qt/addressbookpage.cpp:284:        tr("Comma separated file", "Name of CSV file format") + QLatin1String(" (*.csv)"), nullptr);
    1src/qt/addressbookpage.cpp:299:            tr("There was an error trying to save the address list to %1. Please try again.", "An error message.").arg(filename));
    2src/qt/walletview.cpp:276:        tr("Wallet Data", "Name of wallet data file format") + QLatin1String(" (*.dat)"), nullptr);
    3src/qt/sendcoinsdialog.cpp:435:                tr("Partially Signed Transaction (Binary)", "Name of binary PSBT file format") + QLatin1String(" (*.psbt)"), &selectedFilter);
    4src/qt/transactionview.cpp:339:        tr("Comma separated file", "Name of CSV file format") + QLatin1String(" (*.csv)"), nullptr);
    5src/qt/psbtoperationsdialog.cpp:144:        tr("Partially Signed Transaction (Binary)", "Name of binary PSBT file format") + QLatin1String(" (*.psbt)"), &selected_filter);
    6src/qt/intro.cpp:388:    ui->lblPruneSuffix->setText(tr("(sufficient to restore backups %n day(s) old)", "block chain pruning", expected_backup_days));
    7src/qt/qrimagewidget.cpp:121:        tr("PNG Image", "Name of PNG file format") + QLatin1String(" (*.png)"), nullptr);
    
  17. hebasto merged this on May 27, 2021
  18. hebasto closed this on May 27, 2021

  19. hebasto deleted the branch on May 27, 2021
  20. hebasto cross-referenced this on May 27, 2021 from issue English translations update by hebasto
  21. hebasto referenced this in commit 7076bba841 on May 27, 2021
  22. sidhujag referenced this in commit 3714308fff on May 27, 2021
  23. jarolrod cross-referenced this on Aug 20, 2021 from issue Add copy IP/Netmask action for banned peer by shaavan
  24. gwillen referenced this in commit 4d504fe396 on Jun 1, 2022
  25. bitcoin-core locked this on Aug 16, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 01:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me