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:
Diffstat (limited to 'lib/private/L10N/L10NString.php')
-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);
}