diff --git a/includes/dashboard.php b/includes/dashboard.php index c6e2d686..ddf8ab93 100755 --- a/includes/dashboard.php +++ b/includes/dashboard.php @@ -58,9 +58,17 @@ function DisplayDashboard(): void $hostapdStatus = ($hostapd[0] == 1) ? "active" : ""; $adblockStatus = ($adblock == true) ? "active" : ""; $wirelessClientActive = ($wirelessClients > 0) ? "active" : "inactive"; - $wirelessClientLabel = $wirelessClients. ' WLAN '.$dashboard->formatClientLabel($wirelessClients); + $wirelessClientLabel = sprintf( + _('%d WLAN %s'), + $wirelessClients, + $dashboard->formatClientLabel($wirelessClients) + ); $ethernetClientActive = ($ethernetClients > 0) ? "active" : "inactive"; - $ethernetClientLabel = $ethernetClients. ' LAN '.$dashboard->formatClientLabel($ethernetClients); + $ethernetClientLabel = sprintf( + _('%d LAN %s'), + $ethernetClients, + $dashboard->formatClientLabel($ethernetClients) + ); $totalClientsActive = ($totalClients > 0) ? "active": "inactive"; $freq5active = $freq24active = ""; $varName = "freq" . str_replace('.', '', $frequency) . "active"; diff --git a/src/RaspAP/UI/Dashboard.php b/src/RaspAP/UI/Dashboard.php index 8b2aad59..73d515c2 100644 --- a/src/RaspAP/UI/Dashboard.php +++ b/src/RaspAP/UI/Dashboard.php @@ -208,7 +208,7 @@ class Dashboard { public function formatClientLabel($clientCount) { - return $clientCount === 1 ? 'client' : 'clients'; + return ngettext('client', 'clients', $clientCount); } /*