diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2022-04-26 13:38:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 13:38:15 +0200 |
commit | dffbddcca6fa0221b8f2ac138732cf01154a5187 (patch) | |
tree | 4fa1d31580f9fd12e7ffb176b18614721428ece8 /lib | |
parent | 7ab1fcf3c43992f3f27f1884eb6d912a79cfbb61 (diff) | |
parent | 26882a4b59e947fafc1abe869c34b644e21d499e (diff) | |
download | nextcloud-server-dffbddcca6fa0221b8f2ac138732cf01154a5187.tar.gz nextcloud-server-dffbddcca6fa0221b8f2ac138732cf01154a5187.zip |
Merge pull request #32155 from nextcloud/bugfix/noid/fix-translations-with-trailing-colon
Fx translations with trailing colon
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); } |