Add translation key for `time ago` (#4813)

Co-authored-by: Cyril59310 <archas.cyril@hotmail.fr>
pull/4288/merge
Frank Elsinga 3 months ago committed by GitHub
parent 643d28cebc
commit bde3d0e5ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -14,7 +14,7 @@
v-if="!$root.isMobile && size !== 'small' && beatList.length > 4 && $root.styleElapsedTime !== 'none'" v-if="!$root.isMobile && size !== 'small' && beatList.length > 4 && $root.styleElapsedTime !== 'none'"
class="d-flex justify-content-between align-items-center word" :style="timeStyle" class="d-flex justify-content-between align-items-center word" :style="timeStyle"
> >
<div>{{ timeSinceFirstBeat }} ago</div> <div>{{ timeSinceFirstBeat }}</div>
<div v-if="$root.styleElapsedTime === 'with-line'" class="connecting-line"></div> <div v-if="$root.styleElapsedTime === 'with-line'" class="connecting-line"></div>
<div>{{ timeSinceLastBeat }}</div> <div>{{ timeSinceLastBeat }}</div>
</div> </div>
@ -184,11 +184,11 @@ export default {
} }
if (seconds < tolerance) { if (seconds < tolerance) {
return "now"; return this.$t("now");
} else if (seconds < 60 * 60) { } else if (seconds < 60 * 60) {
return (seconds / 60).toFixed(0) + "m ago"; return this.$t("time ago", [ (seconds / 60).toFixed(0) + "m" ]);
} else { } else {
return (seconds / 60 / 60).toFixed(0) + "h ago"; return this.$t("time ago", [ (seconds / 60 / 60).toFixed(0) + "h" ]);
} }
} }
}, },

@ -49,10 +49,13 @@
"Uptime": "Uptime", "Uptime": "Uptime",
"Cert Exp.": "Cert Exp.", "Cert Exp.": "Cert Exp.",
"Monitor": "Monitor | Monitors", "Monitor": "Monitor | Monitors",
"now": "now",
"time ago": "{0} ago",
"day": "day | days", "day": "day | days",
"-day": "-day", "-day": "-day",
"hour": "hour", "hour": "hour",
"-hour": "-hour", "-hour": "-hour",
"-year": "-year",
"Response": "Response", "Response": "Response",
"Ping": "Ping", "Ping": "Ping",
"Monitor Type": "Monitor Type", "Monitor Type": "Monitor Type",

Loading…
Cancel
Save