diff options
author | Joas Schilling <coding@schilljs.com> | 2022-04-26 12:06:00 +0300 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2022-04-26 14:51:50 +0300 |
commit | 83718ad18afce7793ce16518db904fb378fa090d (patch) | |
tree | 65e0cd44ece92c78609981325c3134ddcf19e86c /lib/private | |
parent | 23a6262f2e73470cfb276d01e606d485ea02933d (diff) |
Fix translations with trailing colonsbackport/32155/stable22
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private')
-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 33ccc4b1409..73199fdbd1c 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); } |