From: Hypolite Petovan Date: Sat, 9 Dec 2023 12:42:15 +0000 (-0500) Subject: Allow count to be a float in L10n->tt() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0b95f39c228023504ed7736ac8461fe47b10b5d4;p=friendica.git Allow count to be a float in L10n->tt() - Address part of https://github.com/friendica/friendica/issues/13699#issuecomment-1848363608 --- diff --git a/src/Core/L10n.php b/src/Core/L10n.php index 80ef832715..ec1cf41112 100644 --- a/src/Core/L10n.php +++ b/src/Core/L10n.php @@ -308,13 +308,13 @@ class L10n * * @param string $singular * @param string $plural - * @param int $count + * @param float $count * @param array $vars Variables to interpolate in the translation string * * @return string * @throws \Exception */ - public function tt(string $singular, string $plural, int $count, ...$vars): string + public function tt(string $singular, string $plural, float $count, ...$vars): string { $s = null; @@ -361,9 +361,9 @@ class L10n * * @return bool */ - private function stringPluralSelectDefault(int $n): bool + private function stringPluralSelectDefault(float $n): bool { - return $n != 1; + return intval($n) != 1; } /**