diff options
author | Joas Schilling <coding@schilljs.com> | 2022-04-26 11:06:00 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2022-04-26 11:41:15 +0000 |
commit | d1dc2a18eefd4125981acb92f36ce205977baa50 (patch) | |
tree | 5a00e21cd990015e5802ce738844fd1904f51f8c /lib | |
parent | 0b7ab9c092d0d4f98d5bae823c5d41aba9f32ea1 (diff) | |
download | nextcloud-server-d1dc2a18eefd4125981acb92f36ce205977baa50.tar.gz nextcloud-server-d1dc2a18eefd4125981acb92f36ce205977baa50.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); } |