]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix translations with trailing colons 32160/head
authorJoas Schilling <coding@schilljs.com>
Tue, 26 Apr 2022 09:06:00 +0000 (11:06 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 26 Apr 2022 11:45:57 +0000 (11:45 +0000)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/L10N/L10NString.php

index 33ccc4b140964ab2db2fdeb4f777298d6c4665e1..73199fdbd1c09a83227542e6f991248100b92848 100644 (file)
@@ -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);
        }