Skip to content

Commit 0580219

Browse files
committed
refactor: Avoid concatenation of format strings
Instead just concatenate already formatted strings. This allows untranslated format strings to be checked at compile time now, and translated format strings to be checked at compile time in #31061.
1 parent 17372d7 commit 0580219

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
886886
}
887887
bilingual_str errors;
888888
for (const auto& arg : args.GetUnsuitableSectionOnlyArgs()) {
889-
errors += strprintf(_("Config setting for %s only applied on %s network when in [%s] section.") + Untranslated("\n"), arg, ChainTypeToString(chain), ChainTypeToString(chain));
889+
errors += strprintf(_("Config setting for %s only applied on %s network when in [%s] section."), arg, ChainTypeToString(chain), ChainTypeToString(chain)) + Untranslated("\n");
890890
}
891891

892892
if (!errors.empty()) {
@@ -901,7 +901,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
901901
// Warn if unrecognized section name are present in the config file.
902902
bilingual_str warnings;
903903
for (const auto& section : args.GetUnrecognizedSections()) {
904-
warnings += strprintf(Untranslated("%s:%i ") + _("Section [%s] is not recognized.") + Untranslated("\n"), section.m_file, section.m_line, section.m_name);
904+
warnings += Untranslated(strprintf("%s:%i ", section.m_file, section.m_line)) + strprintf(_("Section [%s] is not recognized."), section.m_name) + Untranslated("\n");
905905
}
906906

907907
if (!warnings.empty()) {

0 commit comments

Comments
 (0)