diff options
author | Joas Schilling <coding@schilljs.com> | 2022-04-26 11:06:00 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-04-26 11:06:00 +0200 |
commit | 26882a4b59e947fafc1abe869c34b644e21d499e (patch) | |
tree | ebc4746928bebba45dd9f9af14aa96b3ec218d8b /lib | |
parent | a4cd9fd37cb5345f2bd45cac639c6e69fab37ad1 (diff) | |
download | nextcloud-server-26882a4b59e947fafc1abe869c34b644e21d499e.tar.gz nextcloud-server-26882a4b59e947fafc1abe869c34b644e21d499e.zip |
Fix translations with trailing colons
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/L10N/L10NString.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/L10N/L10NString.php b/lib/private/L10N/L10NString.php index de4bc38d744..472a80a5b75 100644 --- a/lib/private/L10N/L10NString.php +++ b/lib/private/L10N/L10NString.php @@ -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); } |