bilingual_str
type argument support to the AbortNode()
functions.
This PR could be tested with a patch similar to the following:
0diff --git a/src/qt/locale/bitcoin_nl.ts b/src/qt/locale/bitcoin_nl.ts
1index 73c18cd4d..13bda2db2 100644
2--- a/src/qt/locale/bitcoin_nl.ts
3+++ b/src/qt/locale/bitcoin_nl.ts
4@@ -3524,8 +3524,8 @@ Notitie: Omdat de vergoeding per byte wordt gerekend, zal een vergoeding van "10
5 <translation>P2P-adressen aan het laden...</translation>
6 </message>
7 <message>
8- <source>Error: Disk space is too low!</source>
9- <translation>Error: Opslagruimte te weinig!</translation>
10+ <source>Disk space is too low!</source>
11+ <translation>Opslagruimte te weinig!</translation>
12 </message>
13 <message>
14 <source>Loading banlist...</source>
15diff --git a/src/validation.cpp b/src/validation.cpp
16index 9034f66e9..c9539c325 100644
17--- a/src/validation.cpp
18+++ b/src/validation.cpp
19@@ -2317,7 +2317,7 @@ bool CChainState::FlushStateToDisk(
20 // Write blocks and block index to disk.
21 if (fDoFullFlush || fPeriodicWrite) {
22 // Depend on nMinDiskSpace to ensure we can write block index
23- if (!CheckDiskSpace(GetBlocksDir())) {
24+ if (CheckDiskSpace(GetBlocksDir())) {
25 return AbortNode(state, "Disk space is too low!", _("Disk space is too low!"));
26 }
27 {
0$ ./src/qt/bitcoin-qt -testnet -lang=nl
1Error: Disk space is too low!
2Error: Disk space is too low!
3Error: Disk space is too low!
0$ tail -4 ~/.bitcoin/testnet3/debug.log
12020-05-10T09:55:41Z [shutoff] *** Disk space is too low!
22020-05-10T09:55:41Z [shutoff] Error: Disk space is too low!
32020-05-10T09:55:41Z [shutoff] ForceFlushStateToDisk: failed to flush state (Disk space is too low!)
42020-05-10T09:55:41Z [shutoff] Shutdown: done
15@@ -16,6 +16,11 @@
16 struct bilingual_str {
17 std::string original;
18 std::string translated;
19+
20+ bool empty() const
21+ {
22+ return original.empty() && translated.empty();
0 return original.empty();
I think translators should not be able to influence executions paths by blanking messages
I think translators should not be able to influence executions paths by blanking messages
Sure!
Updated 1511dd0b1a44727be652b61256899b0ce8024178 -> 6fad0cf7a9b9492e92f6331db4cd6fcd14977d5e (pr18927.02 -> pr18927.03, diff):
I think translators should not be able to influence executions paths by blanking messages
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
No conflicts as of last run.
Updated 6fad0cf7a9b9492e92f6331db4cd6fcd14977d5e -> 4067da94bbf24c6b2b9d45808ae33dc9e7b9d6d4 (pr18927.03 -> pr18927.04, diff):
bilingual_str::empty()
Since bilingual_str type is fully supported, the MSG_NOPREFIX flag is no
longer needed.
Needs rebase
Rebased c5e34e58801654028e3039188e2882e25df594a4 -> d924f2a596c8f37deb2dd94069c578244823c31f (pr18927.05 -> pr18927.07).
1664 if (!userMessage.empty()) {
1665- uiInterface.ThreadSafeMessageBox(Untranslated(userMessage), "", CClientUIInterface::MSG_ERROR | prefix);
1666+ uiInterface.ThreadSafeMessageBox(userMessage, "", CClientUIInterface::MSG_ERROR);
1667 } else {
1668- uiInterface.ThreadSafeMessageBox(_("Error: A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR | CClientUIInterface::MSG_NOPREFIX);
1669+ uiInterface.ThreadSafeMessageBox(_("A fatal internal error occurred, see debug.log for details"), "", CClientUIInterface::MSG_ERROR);
Now that the signature is identical to InitError, the call could be simplified to just a call to AbortError
, which would be a new alias for InitError?
0constexpr auto AbortError = InitError;
Now that the signature is identical to InitError…
Which function signature do you mean?
All that InitError does is pass a translated string into ThreadSafeMessageBox
, so this line could be replaced by a simple call to InitError, no?
0 AbortError(_("A fatal internal error occurred, see debug.log for details"));
Updated d924f2a596c8f37deb2dd94069c578244823c31f -> 5527be06277647dffe7cda587c4bbfbec2a5c8ca (pr18927.07 -> pr18927.08, diff):
ACK 5527be06277647dffe7cda587c4bbfbec2a5c8ca 👟
Signature:
0-----BEGIN PGP SIGNED MESSAGE-----
1Hash: SHA512
2
3ACK 5527be06277647dffe7cda587c4bbfbec2a5c8ca 👟
4-----BEGIN PGP SIGNATURE-----
5
6iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
7pUi2JQwAwwhgq56EfM6hpOzafEWzJZZinddkJuSLzeiDHy1b7SUgQVooQWpqBqiJ
8KaI87+DzkSGBOu0vqoy2DjuuFcyLpHSdOQ8fAJFOYbfxbx6M37bY7Hch+eeYivjt
9k5gPNiVBPzz6h68fxgPNshwHVR6qWzI5RgOe8/GsYrPbGjh42ueYgVZcHdxgqHEP
10vjHJzkU31LW3Ntqg1P6VuYt8uxGvXiejQOjACs9FxWgtemZMRnvHSrUIGfWNyRPt
11G9Y2ClnpZ5rhy6CW3FlyCPEtY6GofbQ9AUEUo/R6Dxv4xVk9xBw1wJ0vwV7q/clW
12OjTQgr8LK8puSiGHAhc3ee+3n+hsDmIuzfY4xLv3E4Bqe7/jbvlyNzQe/UfAiGSK
138PqZp0jk+ZG87qZuwNKYytvXDPNOAorN1SO8bIWUlt0cTlfKfQcdHnHAQYMdUxkl
14Xsu5LcmEgyuerJ7pPQCQ5gVYpCScCNjzwvOIKdkggY1zBJNB2YkdP3aKMYU+ezdL
15UbthjJ2Q
16=zsXO
17-----END PGP SIGNATURE-----
Timestamp of file with hash c4a6904cff17d24ba7d628d970246ed0ce8d86a0caa4d68859d702cd905c7c6a -