Fix InitError() and InitWarning() content #15329

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:20190202-initerror changing 3 files +42 −43
  1. hebasto commented at 9:14 PM on February 2, 2019: member

    Currently, related to wallets and wrong command-line/config option values InitError() and InitWarning() contents are translated partially: some are translated, others are not.

    This PR make translations of all such messages which are meaningful for a user/translator.

    Also this PR prevents command-line/config option names from translation in InitError() and InitWarning() calls (that is not the case in master).

  2. MarcoFalke commented at 9:17 PM on February 2, 2019: member

    I'd say some of the errors are exceptions that rarely happen and shouldn't be translated

  3. hebasto renamed this:
    [WIP] Fix InitError() and InitWarning() content
    Fix InitError() and InitWarning() content
    on Feb 2, 2019
  4. hebasto commented at 9:45 PM on February 2, 2019: member

    @MarcoFalke added rationale, removed [WIP]

  5. laanwj commented at 9:51 PM on February 2, 2019: member

    I'd say some of the errors are exceptions that rarely happen and shouldn't be translated

    I agree. There's also the problem, especially with extremely rare error messages (such as the secp256k1 failure) that translating them makes them impossible to google. This doesn't really weigh up to the advantage of translating the message if it's very technical in the first place, so translating won't help the user understand it. It also requires the translator to understand which may not be reasonable.

    So I'm not convinced this is a good thing.

  6. hebasto commented at 9:54 PM on February 2, 2019: member

    @laanwj

    There's also the problem, especially with extremely rare error messages (such as the secp256k1 failure) that translating them makes them impossible to google.

    Agree. Should 128148775ee465047c2a9c0e2a92277981b1a4b7 commit be removed completely or InitSanityCheck()-related part only?

  7. laanwj commented at 9:58 PM on February 2, 2019: member

    I'd say yes. (coincidentally, too late for this for 0.18, translation string freeze was February 1)

  8. hebasto commented at 10:05 PM on February 2, 2019: member

    @laanwj

    (coincidentally, too late for this for 0.18, translation string freeze was February 1)

    I know it from the last IRC meeting. 0.18 is not the target for this PR :)

  9. MarcoFalke added this to the milestone 0.19.0 on Feb 2, 2019
  10. hebasto renamed this:
    Fix InitError() and InitWarning() content
    [WIP] Fix InitError() and InitWarning() content
    on Feb 2, 2019
  11. DrahtBot commented at 10:33 PM on February 2, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #16127 (Add support for thread safety annotations when using std::mutex by ajtowns)
    • #16112 (util: Log early messages by MarcoFalke)
    • #15946 (Allow maintaining the blockfilterindex when using prune by jonasschnelli)
    • #15891 (test: Require standard txs in regtest by default by MarcoFalke)
    • #15606 ([experimental] UTXO snapshots by jamesob)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  12. hebasto force-pushed on Feb 2, 2019
  13. hebasto commented at 11:06 PM on February 2, 2019: member
  14. hebasto force-pushed on Feb 2, 2019
  15. hebasto renamed this:
    [WIP] Fix InitError() and InitWarning() content
    Fix InitError() and InitWarning() content
    on Feb 2, 2019
  16. hebasto commented at 11:59 PM on February 2, 2019: member

    I'd say some of the errors are exceptions that rarely happen and shouldn't be translated

    Removed translations of error messages inside InitSanityCheck(). PR description updated.

  17. hebasto commented at 12:33 PM on February 3, 2019: member

    Translation Strings Policy:

    Anything that appears to the user in the GUI is to be translated. This includes labels, menu items, button texts, tooltips and window titles. This includes messages passed to the GUI through the UI interface through InitMessage, ThreadSafeMessageBox or ShowProgress.

  18. hebasto commented at 12:39 PM on February 3, 2019: member

    Ref: comment by @laanwj:

    I think errors relating directly to user options should be kept translated.

  19. DrahtBot added the label Needs rebase on Feb 4, 2019
  20. hebasto force-pushed on Feb 17, 2019
  21. DrahtBot removed the label Needs rebase on Feb 17, 2019
  22. DrahtBot added the label Needs rebase on Mar 4, 2019
  23. hebasto force-pushed on Mar 9, 2019
  24. hebasto commented at 5:24 PM on March 9, 2019: member

    Rebased.

  25. DrahtBot removed the label Needs rebase on Mar 9, 2019
  26. DrahtBot added the label Wallet on Mar 19, 2019
  27. DrahtBot added the label Needs rebase on Mar 21, 2019
  28. Translate appropriate InitError() content fa24aff95e
  29. Never translate option names 71fcc30b95
  30. hebasto force-pushed on Apr 23, 2019
  31. hebasto commented at 7:39 PM on April 23, 2019: member

    Rebased.

  32. DrahtBot removed the label Needs rebase on Apr 23, 2019
  33. tryphe referenced this in commit 12655612e4 on May 10, 2019
  34. in src/init.cpp:1386 in 71fcc30b95
    1382 | @@ -1384,7 +1383,7 @@ bool AppInitMain(InitInterfaces& interfaces)
    1383 |          for (const std::string& snet : gArgs.GetArgs("-onlynet")) {
    1384 |              enum Network net = ParseNetwork(snet);
    1385 |              if (net == NET_UNROUTABLE)
    1386 | -                return InitError(strprintf(_("Unknown network specified in -onlynet: '%s'"), snet));
    1387 | +                return InitError(strprintf(_("Unknown network specified in %s: '%s'"), "-onlynet", snet));
    


    PastaPastaPasta commented at 2:46 AM on June 6, 2019:

    bodies of an if statement should be on the same line or in brackets, imo this could be fixed in this PR

  35. in src/init.cpp:1435 in 71fcc30b95
    1432 | +                return InitError(strprintf(_("Invalid %s address or hostname: '%s'"), "-onion", onionArg));
    1433 |              }
    1434 |              proxyType addrOnion = proxyType(onionProxy, proxyRandomize);
    1435 |              if (!addrOnion.IsValid())
    1436 | -                return InitError(strprintf(_("Invalid -onion address or hostname: '%s'"), onionArg));
    1437 | +                return InitError(strprintf(_("Invalid %s address or hostname: '%s'"), "-onion", onionArg));
    


    PastaPastaPasta commented at 2:46 AM on June 6, 2019:

    same as above, same line or brackets

  36. in src/init.cpp:1831 in 71fcc30b95
    1827 | @@ -1829,7 +1828,7 @@ bool AppInitMain(InitInterfaces& interfaces)
    1828 |          CSubNet subnet;
    1829 |          LookupSubNet(net.c_str(), subnet);
    1830 |          if (!subnet.IsValid())
    1831 | -            return InitError(strprintf(_("Invalid netmask specified in -whitelist: '%s'"), net));
    1832 | +            return InitError(strprintf(_("Invalid netmask specified in %s: '%s'"), "-whitelist", net));
    


    PastaPastaPasta commented at 2:46 AM on June 6, 2019:

    same as above, same line or brackets

  37. in src/wallet/init.cpp:123 in 71fcc30b95
     120 |          }
     121 |      }
     122 |  
     123 |      if (gArgs.GetBoolArg("-sysperms", false))
     124 | -        return InitError("-sysperms is not allowed in combination with enabled wallet functionality");
     125 | +        return InitError(strprintf(_("%s is not allowed in combination with enabled wallet functionality"), "-sysperms"));
    


    PastaPastaPasta commented at 2:47 AM on June 6, 2019:

    same line or brackets

  38. in src/wallet/init.cpp:125 in 71fcc30b95
     123 |      if (gArgs.GetBoolArg("-sysperms", false))
     124 | -        return InitError("-sysperms is not allowed in combination with enabled wallet functionality");
     125 | +        return InitError(strprintf(_("%s is not allowed in combination with enabled wallet functionality"), "-sysperms"));
     126 |      if (gArgs.GetArg("-prune", 0) && gArgs.GetBoolArg("-rescan", false))
     127 | -        return InitError(_("Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again."));
     128 | +        return InitError(strprintf(_("Rescans are not possible in pruned mode. You will need to use %s which will download the whole blockchain again."), "-reindex"));
    


    PastaPastaPasta commented at 2:47 AM on June 6, 2019:

    same line or brackets

  39. PastaPastaPasta changes_requested
  40. in src/init.cpp:920 in 71fcc30b95
     916 | @@ -917,7 +917,7 @@ bool AppInitBasicSetup()
     917 |  #endif
     918 |  
     919 |      if (!SetupNetworking())
     920 | -        return InitError("Initializing networking failed");
     921 | +        return InitError(_("Initializing networking failed"));
    


    MarcoFalke commented at 7:38 PM on June 14, 2019:

    Tend to NACK. This will put the translated message into the debug log


    MarcoFalke commented at 7:40 PM on June 14, 2019:

    I guess the translation should be registered here only and then later translated in InitError with _()

  41. hebasto commented at 6:04 AM on June 15, 2019: member

    @MarcoFalke

    Tend to NACK. This will put the translated message into the debug log

    I guess the translation should be registered here only and then later translated in InitError with _()

    Agree. There was a dedicated PR #15340.

    So, closing this PR now.

  42. hebasto closed this on Jun 15, 2019

  43. tryphe referenced this in commit c45779cfef on Jul 18, 2019
  44. hebasto deleted the branch on Jun 13, 2020
  45. DrahtBot locked this on Feb 15, 2022
Labels

Milestone
0.19.0


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 15:14 UTC

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