Simplify singular/plural translations

This commit is contained in:
Leendert de Borst
2025-07-29 14:49:37 +02:00
parent de4b102397
commit a11052bc77
14 changed files with 28 additions and 40 deletions

View File

@@ -110,11 +110,19 @@ const EmailsList: React.FC = () => {
} else if (secondsAgo < 3600) {
// Less than 1 hour ago
const minutes = Math.floor(secondsAgo / 60);
return t('emails.dateFormat.minutesAgo', { count: minutes });
if (minutes === 1) {
return t('emails.time.minutesAgo_single', { count: minutes });
} else {
return t('emails.time.minutesAgo_plural', { count: minutes });
}
} else if (secondsAgo < 86400) {
// Less than 24 hours ago
const hours = Math.floor(secondsAgo / 3600);
return t('emails.dateFormat.hoursAgo', { count: hours });
if (hours === 1) {
return t('emails.time.hoursAgo_single', { count: hours });
} else {
return t('emails.time.hoursAgo_plural', { count: hours });
}
} else if (secondsAgo < 172800) {
// Less than 48 hours ago
return t('emails.dateFormat.yesterday');

View File

@@ -285,10 +285,6 @@
"noEmailsDescription": "You have not received any emails at your private email addresses yet. When you receive a new email, it will appear here.",
"dateFormat": {
"justNow": "just now",
"minutesAgo_one": "{{count}} min ago",
"minutesAgo_other": "{{count}} mins ago",
"hoursAgo_one": "{{count}} hr ago",
"hoursAgo_other": "{{count}} hrs ago",
"yesterday": "yesterday"
},
"errors": {

View File

@@ -285,10 +285,10 @@
"noEmailsDescription": "You have not received any emails at your private email addresses yet. When you receive a new email, it will appear here.",
"dateFormat": {
"justNow": "just now",
"minutesAgo_one": "{{count}} min ago",
"minutesAgo_other": "{{count}} mins ago",
"hoursAgo_one": "{{count}} hr ago",
"hoursAgo_other": "{{count}} hrs ago",
"minutesAgo_single": "{{count}} min ago",
"minutesAgo_plural": "{{count}} mins ago",
"hoursAgo_single": "{{count}} hr ago",
"hoursAgo_plural": "{{count}} hrs ago",
"yesterday": "yesterday"
},
"errors": {

View File

@@ -285,10 +285,6 @@
"noEmailsDescription": "You have not received any emails at your private email addresses yet. When you receive a new email, it will appear here.",
"dateFormat": {
"justNow": "just now",
"minutesAgo_one": "{{count}} min ago",
"minutesAgo_other": "{{count}} mins ago",
"hoursAgo_one": "{{count}} hr ago",
"hoursAgo_other": "{{count}} hrs ago",
"yesterday": "yesterday"
},
"errors": {

View File

@@ -285,10 +285,6 @@
"noEmailsDescription": "You have not received any emails at your private email addresses yet. When you receive a new email, it will appear here.",
"dateFormat": {
"justNow": "just now",
"minutesAgo_one": "{{count}} min ago",
"minutesAgo_other": "{{count}} mins ago",
"hoursAgo_one": "{{count}} hr ago",
"hoursAgo_other": "{{count}} hrs ago",
"yesterday": "yesterday"
},
"errors": {

View File

@@ -285,10 +285,6 @@
"noEmailsDescription": "Je hebt nog geen e-mails ontvangen op je privé e-mailadressen. Wanneer je een nieuwe e-mail ontvangt, zal deze hier verschijnen.",
"dateFormat": {
"justNow": "zojuist",
"minutesAgo_one": "{{count}} min geleden",
"minutesAgo_other": "{{count}} min. geleden",
"hoursAgo_one": "{{count}} uur geleden",
"hoursAgo_other": "{{count}} uur geleden",
"yesterday": "gisteren"
},
"errors": {

View File

@@ -285,10 +285,6 @@
"noEmailsDescription": "You have not received any emails at your private email addresses yet. When you receive a new email, it will appear here.",
"dateFormat": {
"justNow": "just now",
"minutesAgo_one": "{{count}} min ago",
"minutesAgo_other": "{{count}} mins ago",
"hoursAgo_one": "{{count}} hr ago",
"hoursAgo_other": "{{count}} hrs ago",
"yesterday": "yesterday"
},
"errors": {

View File

@@ -58,10 +58,18 @@ export function EmailCard({ email }: EmailCardProps) : React.ReactNode {
return t('emails.time.justNow');
} else if (secondsAgo < 3600) {
const minutes = Math.floor(secondsAgo / 60);
return t('emails.time.minutesAgo', { count: minutes });
if (minutes === 1) {
return t('emails.time.minutesAgo_single', { count: minutes });
} else {
return t('emails.time.minutesAgo_plural', { count: minutes });
}
} else if (secondsAgo < 86400) {
const hours = Math.floor(secondsAgo / 3600);
return t('emails.time.hoursAgo', { count: hours });
if (hours === 1) {
return t('emails.time.hoursAgo_single', { count: hours });
} else {
return t('emails.time.hoursAgo_plural', { count: hours });
}
} else if (secondsAgo < 172800) {
return t('emails.time.yesterday');
} else {

View File

@@ -303,8 +303,6 @@
"emptyMessage": "You have not received any emails at your private email addresses yet. When you receive a new email, it will appear here.",
"time": {
"justNow": "just now",
"minutesAgo": "{{count}} {{count, plural, one {min} other {mins}}} ago",
"hoursAgo": "{{count}} {{count, plural, one {hr} other {hrs}}} ago",
"yesterday": "yesterday"
},
"errors": {

View File

@@ -303,8 +303,10 @@
"emptyMessage": "You have not received any emails at your private email addresses yet. When you receive a new email, it will appear here.",
"time": {
"justNow": "just now",
"minutesAgo": "{{count}} {{count, plural, one {min} other {mins}}} ago",
"hoursAgo": "{{count}} {{count, plural, one {hr} other {hrs}}} ago",
"minutesAgo_single": "{{count}} min ago",
"minutesAgo_plural": "{{count}} mins ago",
"hoursAgo_single": "{{count}} hr ago",
"hoursAgo_plural": "{{count}} hrs ago",
"yesterday": "yesterday"
},
"errors": {

View File

@@ -303,8 +303,6 @@
"emptyMessage": "You have not received any emails at your private email addresses yet. When you receive a new email, it will appear here.",
"time": {
"justNow": "just now",
"minutesAgo": "{{count}} {{count, plural, one {min} other {mins}}} ago",
"hoursAgo": "{{count}} {{count, plural, one {hr} other {hrs}}} ago",
"yesterday": "yesterday"
},
"errors": {

View File

@@ -303,8 +303,6 @@
"emptyMessage": "Vous n'avez pas encore reçu d'e-mails sur vos adresses e-mail privées. Quand vous recevez un nouvel e-mail, il apparaîtra ici.",
"time": {
"justNow": "just now",
"minutesAgo": "{{count}} {{count, plural, one {min} other {mins}}} ago",
"hoursAgo": "{{count}} {{count, plural, one {hr} other {hrs}}} ago",
"yesterday": "yesterday"
},
"errors": {

View File

@@ -303,8 +303,6 @@
"emptyMessage": "Je hebt nog geen e-mails ontvangen op je privé e-mailadressen. Wanneer je een nieuwe e-mail ontvangt, zal deze hier verschijnen.",
"time": {
"justNow": "zojuist",
"minutesAgo": "{{count}} {{count, plural, one {min} other {min}}} geleden",
"hoursAgo": "{{count}} {{count, plural, one {uur} other {uur}}} geleden",
"yesterday": "gisteren"
},
"errors": {

View File

@@ -303,8 +303,6 @@
"emptyMessage": "You have not received any emails at your private email addresses yet. When you receive a new email, it will appear here.",
"time": {
"justNow": "just now",
"minutesAgo": "{{count}} {{count, plural, one {min} other {mins}}} ago",
"hoursAgo": "{{count}} {{count, plural, one {hr} other {hrs}}} ago",
"yesterday": "yesterday"
},
"errors": {