1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2025-07-09 19:37:41 +02:00

Revise formatClientLabel() w/ ngettext

This commit is contained in:
billz 2025-03-18 02:13:14 -07:00
parent 615f2abed1
commit cfb8435373
2 changed files with 11 additions and 3 deletions

View File

@ -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";

View File

@ -208,7 +208,7 @@ class Dashboard {
public function formatClientLabel($clientCount)
{
return $clientCount === 1 ? 'client' : 'clients';
return ngettext('client', 'clients', $clientCount);
}
/*