-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Fix InitError() and InitWarning() content #15329
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
Conversation
|
I'd say some of the errors are exceptions that rarely happen and shouldn't be translated |
|
@MarcoFalke added rationale, removed [WIP] |
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. |
Agree. Should 128148775ee465047c2a9c0e2a92277981b1a4b7 commit be removed completely or |
|
I'd say yes. |
I know it from the last IRC meeting. 0.18 is not the target for this PR :) |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
fbf9caa to
7eb863e
Compare
|
Ref: IRC discussion |
7eb863e to
a224845
Compare
Removed translations of error messages inside |
|
a224845 to
5724c08
Compare
5724c08 to
2c7c01a
Compare
|
Rebased. |
2c7c01a to
71fcc30
Compare
|
Rebased. |
| enum Network net = ParseNetwork(snet); | ||
| if (net == NET_UNROUTABLE) | ||
| return InitError(strprintf(_("Unknown network specified in -onlynet: '%s'"), snet)); | ||
| return InitError(strprintf(_("Unknown network specified in %s: '%s'"), "-onlynet", snet)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bodies of an if statement should be on the same line or in brackets, imo this could be fixed in this PR
| proxyType addrOnion = proxyType(onionProxy, proxyRandomize); | ||
| if (!addrOnion.IsValid()) | ||
| return InitError(strprintf(_("Invalid -onion address or hostname: '%s'"), onionArg)); | ||
| return InitError(strprintf(_("Invalid %s address or hostname: '%s'"), "-onion", onionArg)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, same line or brackets
| LookupSubNet(net.c_str(), subnet); | ||
| if (!subnet.IsValid()) | ||
| return InitError(strprintf(_("Invalid netmask specified in -whitelist: '%s'"), net)); | ||
| return InitError(strprintf(_("Invalid netmask specified in %s: '%s'"), "-whitelist", net)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, same line or brackets
|
|
||
| if (gArgs.GetBoolArg("-sysperms", false)) | ||
| return InitError("-sysperms is not allowed in combination with enabled wallet functionality"); | ||
| return InitError(strprintf(_("%s is not allowed in combination with enabled wallet functionality"), "-sysperms")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same line or brackets
| return InitError(strprintf(_("%s is not allowed in combination with enabled wallet functionality"), "-sysperms")); | ||
| if (gArgs.GetArg("-prune", 0) && gArgs.GetBoolArg("-rescan", false)) | ||
| return InitError(_("Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.")); | ||
| return InitError(strprintf(_("Rescans are not possible in pruned mode. You will need to use %s which will download the whole blockchain again."), "-reindex")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same line or brackets
|
|
||
| if (!SetupNetworking()) | ||
| return InitError("Initializing networking failed"); | ||
| return InitError(_("Initializing networking failed")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tend to NACK. This will put the translated message into the debug log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
init: nMaxConnections and (nFD-nFDMin) cannot be negative, don't check against 0 init: try to fix Travis note about deducing types init: try to fix travis again "deduced conflicting types" init: try a better way through the Travis problem init: revert old init warning for drahtbot net: name nit "NUM"->"MAX"_FEELER_CONNCTIONS init: name nit "NUM"->"MAX"_FEELER_CONNCTIONS init: fixup typo
Currently, related to wallets and wrong command-line/config option values
InitError()andInitWarning()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()andInitWarning()calls (that is not the case in master).