Add translation for some missing items

Closes #1123
pull/1124/head
shamoon 2 years ago
parent b488d6a13c
commit 401b35bea9

@ -60,9 +60,15 @@
"tx": "TX",
"mem": "MEM",
"cpu": "CPU",
"running": "Running",
"offline": "Offline",
"error": "Error",
"unknown": "Unknown"
"unknown": "Unknown",
"starting": "Starting",
"unhealthy": "Unhealthy",
"not_found": "Not Found",
"exited": "Exited",
"partial": "Partial"
},
"ping": {
"error": "Error",
@ -365,7 +371,10 @@
"update_available": "Update Available",
"up_to_date": "Up to Date",
"child_bridges": "Child Bridges",
"child_bridges_status": "{{ok}}/{{total}}"
"child_bridges_status": "{{ok}}/{{total}}",
"up": "Up",
"pending": "Pending",
"down": "Down"
},
"healthchecks": {
"new": "New",

@ -12,34 +12,43 @@ export default function Status({ service }) {
</div>
}
let statusLabel = "";
if (data && data.status?.includes("running")) {
if (data.health === "starting") {
return (
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={data.health}>
<div className="text-[8px] font-bold text-blue-500/80 uppercase">{data.health}</div>
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={t("docker.starting")}>
<div className="text-[8px] font-bold text-blue-500/80 uppercase">{t("docker.starting")}</div>
</div>
);
}
if (data.health === "unhealthy") {
return (
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={data.health}>
<div className="text-[8px] font-bold text-orange-400/50 dark:text-orange-400/80 uppercase">{data.health}</div>
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={t("docker.unhealthy")}>
<div className="text-[8px] font-bold text-orange-400/50 dark:text-orange-400/80 uppercase">{t("docker.unhealthy")}</div>
</div>
);
}
if (!data.health) {
statusLabel = data.status.replace("running", t("docker.running"))
}
return (
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={data.health || data.status}>
<div className="text-[8px] font-bold text-emerald-500/80 uppercase">{data.health || data.status}</div>
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={data.health || statusLabel}>
<div className="text-[8px] font-bold text-emerald-500/80 uppercase">{data.health || statusLabel}</div>
</div>
);
}
if (data && (data.status === "not found" || data.status === "exited" || data.status?.startsWith("partial"))) {
if (data.status === "not found") statusLabel = t("docker.not_found")
else if (data.status === "exited") statusLabel = t("docker.exited")
else statusLabel = data.status.replace("partial", t("docker.partial"))
return (
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={data.status}>
<div className="text-[8px] font-bold text-orange-400/50 dark:text-orange-400/80 uppercase">{data.status}</div>
<div className="w-auto px-1.5 py-0.5 text-center bg-theme-500/10 dark:bg-theme-900/50 rounded-b-[3px] overflow-hidden" title={statusLabel}>
<div className="text-[8px] font-bold text-orange-400/50 dark:text-orange-400/80 uppercase">{statusLabel}</div>
</div>
);
}

@ -29,7 +29,7 @@ export default function Component({ service }) {
<Container service={service}>
<Block
label="widget.status"
value={`${homebridgeData.status[0].toUpperCase()}${homebridgeData.status.substr(1)}`}
value={t(`homebridge.${homebridgeData.status}`)}
/>
<Block
label="homebridge.updates"

Loading…
Cancel
Save