Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-04-26 12:06:00 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2022-04-26 14:51:50 +0300
commit83718ad18afce7793ce16518db904fb378fa090d (patch)
tree65e0cd44ece92c78609981325c3134ddcf19e86c
parent23a6262f2e73470cfb276d01e606d485ea02933d (diff)
Fix translations with trailing colonsbackport/32155/stable22
Signed-off-by: Joas Schilling <coding@schilljs.com>
-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 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);
}