mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Fix translations with trailing colons
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
a4cd9fd37c
commit
26882a4b59
1 changed files with 7 additions and 1 deletions
|
|
@ -74,10 +74,16 @@ class L10NString implements \JsonSerializable {
|
|||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue