You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge bitcoin/bitcoin#31061: refactor: Check translatable format strings at compile-time
fa3efb5 refactor: Introduce struct to hold a runtime format string (MarcoFalke)
fa6adb0 lint: Remove unused and broken format string linter (MarcoFalke)
fadc6b9 refactor: Check translatable format strings at compile-time (MarcoFalke)
fa1d5ac refactor: Use TranslateFn type consistently (MarcoFalke)
eeee6cf refactor: Delay translation of _() literals (MarcoFalke)
Pull request description:
All translatable format strings are fixed. This change surfaces errors in them at compile-time.
The implementation achieves this by allowing to delay the translation (or `std::string` construction) that previously happened in `_()` by returning a new type from this function. The new type can be converted to `bilingual_str` where needed.
This can be tested by adding a format string error in an original string literal and observing a new compile-time failure.
Fixesbitcoin/bitcoin#30530
ACKs for top commit:
stickies-v:
re-ACK fa3efb5
ryanofsky:
Code review ACK fa3efb5. Since last review added TranslateFn commit, clarified FormatStringCheck documentation, dropped redundant `inline` keyword
Tree-SHA512: 28fa1db11e85935d998031347bd519675d75c171c8323b0ed6cdd0b628c95250bb86b30876946cc48840ded541e95b8a152696f9f2b13a5f28f5673228ee0509
Copy file name to clipboardExpand all lines: src/clientversion.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@ std::string LicenseInfo()
95
95
strprintf(_("The source code is available from %s."), URL_SOURCE_CODE).translated +
96
96
"\n" +
97
97
"\n" +
98
-
_("This is experimental software.").translated + "\n" +
98
+
_("This is experimental software.") + "\n" +
99
99
strprintf(_("Distributed under the MIT software license, see the accompanying file %s or %s"), "COPYING", "<https://opensource.org/licenses/MIT>").translated +
0 commit comments