mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-12 13:00:01 -08:00
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:
parent
0798d28dc9
commit
dec5e217a2
1 changed files with 18 additions and 13 deletions
|
|
@ -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};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue