Remove leading spaces from message log zone strings (#4945)

The "from …" fragments built by getFromStr() carried a leading space so
the sentence templates could concatenate them directly (%2%3). That blank
is invisible on Transifex and most translations dropped it, merging the
card name and the zone phrase in the log (#4943).

Drop the blank from the tr() strings and add the separator in code where
the fragment is built. The space is only prepended when the fragment is
non-empty, so messages that put the zone in the card name instead — "the
top card of their library." — keep their punctuation tight.

The templates stay at %2%3, since %3 is empty on those paths.
This commit is contained in:
tooomm 2026-11-06 21:43:14 +01:00 • committed by GitHub
parent 0798d28dc9
commit dec5e217a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -120,6 +120,11 @@ MessageLogWidget::getFromStr(CardZoneLogic *zone, QString cardName, int position
if (!cardNameContainsStartZone) { if (!cardNameContainsStartZone) {
cardName.clear(); cardName.clear();
} }
// The separator space is added here rather than stored in the tr() string so
// translators never have to preserve an invisible leading blank.
if (!fromStr.isEmpty()) {
fromStr.prepend(' ');
}
return {cardName, fromStr}; return {cardName, fromStr};
} }