Merge pull request #13708 from MrPetovan/bug/deprecated

Fix a couple deprecation notices
This commit is contained in:
Michael Vogel 2023-12-10 20:17:53 +01:00 committed by GitHub
commit b561f6ffd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -308,13 +308,13 @@ class L10n
* *
* @param string $singular * @param string $singular
* @param string $plural * @param string $plural
* @param int $count * @param float $count
* @param array $vars Variables to interpolate in the translation string * @param array $vars Variables to interpolate in the translation string
* *
* @return string * @return string
* @throws \Exception * @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; $s = null;
@ -361,9 +361,9 @@ class L10n
* *
* @return bool * @return bool
*/ */
private function stringPluralSelectDefault(int $n): bool private function stringPluralSelectDefault(float $n): bool
{ {
return $n != 1; return intval($n) != 1;
} }
/** /**

View file

@ -185,8 +185,8 @@ class Federation extends BaseAdmin
$gserver['platform'] = $systems[$platform]['name']; $gserver['platform'] = $systems[$platform]['name'];
$gserver['totallbl'] = DI::l10n()->tt('%2$s total system' , '%2$s total systems' , $gserver['total'], number_format($gserver['total'])); $gserver['totallbl'] = DI::l10n()->tt('%2$s total system' , '%2$s total systems' , $gserver['total'], number_format($gserver['total']));
$gserver['monthlbl'] = DI::l10n()->tt('%2$s active user last month' , '%2$s active users last month' , $gserver['month'] ?? 0, number_format($gserver['month'])); $gserver['monthlbl'] = DI::l10n()->tt('%2$s active user last month' , '%2$s active users last month' , $gserver['month'] ?? 0, number_format($gserver['month'] ?? 0));
$gserver['halfyearlbl'] = DI::l10n()->tt('%2$s active user last six months' , '%2$s active users last six months' , $gserver['halfyear'] ?? 0, number_format($gserver['halfyear'])); $gserver['halfyearlbl'] = DI::l10n()->tt('%2$s active user last six months' , '%2$s active users last six months' , $gserver['halfyear'] ?? 0, number_format($gserver['halfyear'] ?? 0));
$gserver['userslbl'] = DI::l10n()->tt('%2$s registered user' , '%2$s registered users' , $gserver['users'], number_format($gserver['users'])); $gserver['userslbl'] = DI::l10n()->tt('%2$s registered user' , '%2$s registered users' , $gserver['users'], number_format($gserver['users']));
$gserver['postslbl'] = DI::l10n()->tt('%2$s locally created post or comment', '%2$s locally created posts and comments', $gserver['posts'], number_format($gserver['posts'])); $gserver['postslbl'] = DI::l10n()->tt('%2$s locally created post or comment', '%2$s locally created posts and comments', $gserver['posts'], number_format($gserver['posts']));