From e95b208af90cc386a7d8d1bcab426727cf4f0121 Mon Sep 17 00:00:00 2001 From: Minteck Date: Wed, 21 Sep 2022 22:42:33 +0200 Subject: Update time --- app/banner.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'app/banner.js') diff --git a/app/banner.js b/app/banner.js index 81991e9..6815de1 100644 --- a/app/banner.js +++ b/app/banner.js @@ -6,10 +6,10 @@ function timeAgo(time) { time = new Date(time).getTime(); } - let periods = ["second", "minute", "hour", "day", "week", "month", "year", "age"]; + let periods = ["sec.", "mn.", "hr.", "d.", "wk.", "mo.", "y.", "ages"]; if (bannerFrench) { - periods = ["seconde", "minute", "heure", "jour", "semaine", "mois", "an", "des année"]; + periods = ["sec.", "min.", "h.", "j.", "sem.", "mois", "an.", "des années"]; } let lengths = ["60", "60", "24", "7", "4.35", "12", "100"]; @@ -46,7 +46,7 @@ function timeAgo(time) { difference = Math.round(difference); - period = periods[j] + (difference > 1 ? "s" : ''); + period = periods[j]; if (bannerFrench) { return `${tense} ${difference} ${period}`; @@ -130,17 +130,17 @@ async function refreshBanner(offline, french) {
- ${french ? `Préfixe${data['prefixes'].length > 1 ? 's' : ''} ` : `Prefix${data['prefixes'].length > 1 ? 'es' : ''}`}: + ${french ? `Préfixe${data['prefixes'].length > 1 ? 's' : ''} ` : `Prefix${data['prefixes'].length > 1 ? 'es' : ''}`}:
${data['prefixes'].join(', ')}
- ${french ? "Pronoms :" : "Pronouns:"} + ${french ? "Pronoms :" : "Pronouns:"}
${data['id'] === "fusion" ? "she/her" : data['pronouns']}
${!data['median'] && data['id'] !== "unknown" ? ` ${data["id"] === "fusion" ? ` - Fronting since : + Fronting since:
${data['last_fronted'] ? ` ${data['last_fronted']['now'] ? ` ${data['last_fronted']['relative']}
  @@ -148,7 +148,7 @@ async function refreshBanner(offline, french) { Not fronting
  `} ` : `Not fronting
 `}` : ` - ${french ? "Front :" : "Last fronted:"} + ${french ? "Front :" : "Last fronted:"}
${data['last_fronted'] ? ` ${data['last_fronted']['now'] ? ` ${french ? "En ce moment" : "Right now"}
@@ -157,23 +157,23 @@ async function refreshBanner(offline, french) { ${data['last_fronted']['relative']}
(${french ? "pendant" : "for"} ${data['last_fronted']['duration']['pretty']}) `} - ` : `${french ? "Il y a très longtemps" : "A long time ago"}
 `}`} + ` : `${french ? "Jamais" : "Never"}
 `}`}
` : ''} ${data['id'] !== "fusion" ? ` ${data['id'] === "unknown" ? "Species: best to ask" : ` - ${french ? (data['species'].length > 1 ? "Espèces : " : "Espèce : ") : "Species: "} + Species: ${data['species'].map(species => ` ${species['name']} `).join("")}`} ` : ''} ${data['id'] !== "fusion" ? ` - ${french ? "Système : " : "System: "} + System: ${data['system']['name']} ${data['system']['subsystem'] ? ` -
${french ? "Sous-système : " : "Subsystem: "} ${data['system']['subsystem']['name']} +
Subsystem: ${data['system']['subsystem']['name']} ` : data['system']['temporary'] ? '
(temporary)' : ''}
` : ''} @@ -183,20 +183,20 @@ async function refreshBanner(offline, french) { ${french ? (data['relations']['marefriends'].length > 1 ? 'Partenaires ' : 'Partenaire ') : `Marefriend${data['relations']['marefriends'].length > 1 ? 's' : ''}`}: ${data['relations']['marefriends'].length > 1 ? '
' : ''} ${data['relations']['marefriends'].map(relation => ` - ${relation['name']}`).join(`,
`)} + `).join(``)} ${data['relations']['marefriends'].length === 0 ? '-' : ''}
${french ? (data['relations']['sisters'].length > 1 ? 'Sœurs ' : 'Sœur ') : `Sister${data['relations']['sisters'].length > 1 ? 's' : ''}`}: ${data['relations']['sisters'].length > 1 ? '
' : ''} ${data['relations']['sisters'].map(relation => ` - ${relation['name']}`).join(`,
`)} + `).join(``)} ${data['relations']['sisters'].length === 0 ? '-' : ''}
${data['little'] ? ` - ${french ? (data['relations']['sisters'].length > 1 ? 'Caretakers ' : 'Caretaker ') : `Caretakers${data['relations']['caretakers'].length > 1 ? 's' : ''}`}: ${data['relations']['caretakers'].length > 1 ? '
' : ''} + ${french ? (data['relations']['sisters'].length > 1 ? 'Caretakers ' : 'Caretaker ') : `Caretaker${data['relations']['caretakers'].length > 1 ? 's' : ''}`}: ${data['relations']['caretakers'].length > 1 ? '
' : ''} ${data['relations']['caretakers'].map(relation => ` - ${relation['name']}`).join(`,
`)} + `).join(``)} ${data['relations']['caretakers'].length === 0 ? '-' : ''}
` : ''} -- cgit