diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 7dbd53d67..53e76bd98 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -685,6 +685,9 @@ "approved": "Approved" }, "gamedig": { + "status": "Status", + "online": "Online", + "offline": "Offline", "name": "Name", "map": "Map", "currentPlayers": "Current players", diff --git a/src/widgets/gamedig/component.jsx b/src/widgets/gamedig/component.jsx index 3ddf909aa..1acfc6e15 100644 --- a/src/widgets/gamedig/component.jsx +++ b/src/widgets/gamedig/component.jsx @@ -26,6 +26,7 @@ export default function Component({ service }) { if (!serverData) { return ( + @@ -37,23 +38,25 @@ export default function Component({ service }) { ); } + const status = serverData.online ? {t("gamedig.online")} : {t("gamedig.offline")}; const name = serverData.online ? serverData.name : "-"; const map = serverData.online ? serverData.map : "-"; const currentPlayers = serverData.online ? `${serverData.players} / ${serverData.maxplayers}` : "-"; const players = serverData.online ? `${serverData.players}` : "-"; const maxPlayers = serverData.online ? `${serverData.maxplayers}` : "-"; const bots = serverData.online ? `${serverData.bots}` : "-"; - const ping = serverData.online ? `${serverData.ping}` : 0; + const ping = serverData.online ? `${t("common.ms", { value: serverData.ping, style: "unit", unit: "millisecond" })}` : "-"; return ( + - + ); }