From 6e7b66060e8655e013b74140b30f41f6d5ee52e8 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Mon, 30 May 2022 18:15:13 +0200 Subject: support for singular players While it's unlikely we'll ever get down to 1 player, it's best to be on the safe side :p --- src/app/launcher.js | 12 ++++++------ src/lang/en.json | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/app/launcher.js b/src/app/launcher.js index 719048e..569d0fe 100644 --- a/src/app/launcher.js +++ b/src/app/launcher.js @@ -135,14 +135,14 @@ async function loadServers() { if (servercount == 0 || ! servercount || ! playercount) {masterserver = false} + let playerstr = lang("gui.server.players"); + if (playercount == 1) { + playerstr = lang("gui.server.player"); + } + if (masterserver) { serverstatus.classList.add("up"); - // servercount and playercount don't actually get set anywhere, - // the reason for this is, while writing this code, the master - // server is down so I don't have anyway to test the code... - // - // it'll be added whenever the masterserver comes online again. - serverstatus.innerHTML = `${servercount} ${lang("gui.server.servers")} - ${playercount} ${lang("gui.server.players")}`; + serverstatus.innerHTML = `${servercount} ${lang("gui.server.servers")} - ${playercount} ${playerstr}`; } else { serverstatus.classList.add("down"); serverstatus.innerHTML = lang("gui.server.offline"); diff --git a/src/lang/en.json b/src/lang/en.json index 045517d..34c4619 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -113,8 +113,9 @@ "gui.nsupdate.gaming.title": "Northstar update available!", "gui.nsupdate.gaming.body": "An update for Northstar is available.\nYou can force its installation after closing the game.", - "gui.server.servers": "servers", + "gui.server.player": "player", "gui.server.players": "players", + "gui.server.servers": "servers", "gui.server.offline": "Masterserver is Offline", "gui.launch": "Launch", -- cgit v1.2.3