]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Admin/Federation.php
Merge remote-tracking branch 'upstream/develop' into diaspora-reshare
[friendica.git] / src / Module / Admin / Federation.php
index c5badefe90cfe69da530e634700c9ef4c595fc89..0fae254ddc915a3dee12d511d61d0ae9c1461ca8 100644 (file)
@@ -21,6 +21,7 @@
 
 namespace Friendica\Module\Admin;
 
+use Friendica\App;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
@@ -38,6 +39,7 @@ class Federation extends BaseAdmin
                // We list the more common systems by name. The rest is counted as "other"
                $systems = [
                        'friendica'    => ['name' => 'Friendica', 'color' => '#ffc018'], // orange from the logo
+                       'akkoma'       => ['name' => 'Akkoma', 'color' => '#9574cd'], // Color from the page
                        'birdsitelive' => ['name' => 'BirdsiteLIVE', 'color' => '#1b6ec2'], // Color from the page
                        'bookwyrm'     => ['name' => 'BookWyrm', 'color' => '#00d1b2'], // Color from the page
                        'castopod'     => ['name' => 'Castopod', 'color' => '#00564a'], // Background color from the page
@@ -153,7 +155,7 @@ class Federation extends BaseAdmin
 
                        if ($platform == 'friendica') {
                                $versionCounts = self::reformaFriendicaVersions($versionCounts);
-                       } elseif ($platform == 'pleroma') {
+                       } elseif (in_array($platform, ['pleroma', 'akkoma'])) {
                                $versionCounts = self::reformaPleromaVersions($versionCounts);
                        } elseif ($platform == 'diaspora') {
                                $versionCounts = self::reformaDiasporaVersions($versionCounts);
@@ -170,26 +172,26 @@ class Federation extends BaseAdmin
                        }
 
                        $gserver['platform']    = $systems[$platform]['name'];
-                       $gserver['totallbl']    = DI::l10n()->t('%s total systems', number_format($gserver['total']));
-                       $gserver['monthlbl']    = DI::l10n()->t('%s active users last month', number_format($gserver['month']));
-                       $gserver['halfyearlbl'] = DI::l10n()->t('%s active users last six months', number_format($gserver['halfyear']));
-                       $gserver['userslbl']    = DI::l10n()->t('%s registered users', number_format($gserver['users']));
-                       $gserver['postslbl']    = DI::l10n()->t('%s locally created posts and comments', number_format($gserver['posts']));
+                       $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['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['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']));
 
                        if (($gserver['users'] > 0) && ($gserver['posts'] > 0)) {
-                               $gserver['postsuserlbl'] = DI::l10n()->t('%s posts per user', number_format($gserver['posts'] / $gserver['users'], 1));
+                               $gserver['postsuserlbl'] = DI::l10n()->tt('%2$s post per user', '%2$s posts per user', $gserver['posts'] / $gserver['users'], number_format($gserver['posts'] / $gserver['users'], 1));
                        } else {
                                $gserver['postsuserlbl'] = '';
                        }
                        if (($gserver['users'] > 0) && ($gserver['total'] > 0)) {
-                               $gserver['userssystemlbl'] = DI::l10n()->t('%s users per system', number_format($gserver['users'] / $gserver['total'], 1));
+                               $gserver['userssystemlbl'] = DI::l10n()->tt('%2$s user per system', '%2$s users per system', $gserver['users'] / $gserver['total'], number_format($gserver['users'] / $gserver['total'], 1));
                        } else {
                                $gserver['userssystemlbl'] = '';
                        }
 
                        $counts[$platform] = [$gserver, $versionCounts, str_replace([' ', '%', '.'], '', $platform), $systems[$platform]['color']];
                }
-               DBA::close($gserver);
+               DBA::close($gservers);
 
                // some helpful text
                $intro = DI::l10n()->t('This page offers you some numbers to the known part of the federated social network your Friendica node is part of. These numbers are not complete but only reflect the part of the network your node is aware of.');
@@ -201,8 +203,8 @@ class Federation extends BaseAdmin
                        '$page' => DI::l10n()->t('Federation Statistics'),
                        '$intro' => $intro,
                        '$counts' => $counts,
-                       '$version' => FRIENDICA_VERSION,
-                       '$legendtext' => DI::l10n()->t('Currently this node is aware of %s nodes (%s active users last month, %s active users last six months, %s registered users in total) from the following platforms:', number_format($total), number_format($month), number_format($halfyear), number_format($users)),
+                       '$version' => App::VERSION,
+                       '$legendtext' => DI::l10n()->tt('Currently this node is aware of %2$s node (%3$s active users last month, %4$s active users last six months, %5$s registered users in total) from the following platforms:', 'Currently this node is aware of %2$s nodes (%3$s active users last month, %4$s active users last six months, %5$s registered users in total) from the following platforms:', $total, number_format($total), number_format($month), number_format($halfyear), number_format($users)),
                ]);
        }