Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix translations with trailing colons
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen authored and backportbot[bot] committed Apr 26, 2022
commit d1dc2a18eefd4125981acb92f36ce205977baa50
8 changes: 7 additions & 1 deletion lib/private/L10N/L10NString.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,16 @@ public function __toString(): string {
return 'Can not use pipe character in translations';
}

$beforeIdentity = $identity;
$identity = str_replace('%n', '%count%', $identity);

$parameters = [];
if ($beforeIdentity !== $identity) {
$parameters = ['%count%' => $this->count];
}

// $count as %count% as per \Symfony\Contracts\Translation\TranslatorInterface
$text = $identityTranslator->trans($identity, ['%count%' => $this->count]);
$text = $identityTranslator->trans($identity, $parameters);

return vsprintf($text, $this->parameters);
}
Expand Down