summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-05-16 11:50:51 +0200
committerGitHub <noreply@github.com>2022-05-16 11:50:51 +0200
commit5b4df735ec04bd6bca5cd4655d8c987399bc6bf2 (patch)
tree9bba8b406a606fe183f2658aee2d4ff691800a88 /lib
parent89b4f5cf8fa905194f443ca93bd454f3247d90aa (diff)
parentd1dc2a18eefd4125981acb92f36ce205977baa50 (diff)
downloadnextcloud-server-5b4df735ec04bd6bca5cd4655d8c987399bc6bf2.tar.gz
nextcloud-server-5b4df735ec04bd6bca5cd4655d8c987399bc6bf2.zip
Merge pull request #32159 from nextcloud/backport/32155/stable24
[stable24] Fx translations with trailing colon
Diffstat (limited to 'lib')
-rw-r--r--lib/private/L10N/L10NString.php8
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);
}