chore(i18n): improve overdue task emails translation

This commit is contained in:
kolaente 2025-05-21 10:28:50 +02:00
parent b307041393
commit c4566fdb53
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
2 changed files with 7 additions and 7 deletions

View File

@ -92,11 +92,12 @@
},
"overdue": {
"subject": "Task \"%[1]s\" (%[2]s) is overdue",
"message": "This is a friendly reminder of the task \"%[1]s\" (%[2]s) which is %[3]s and not yet done.",
"message": "This is a friendly reminder of the task \"%[1]s\" (%[2]s) which is overdue %[3]s and not yet done.",
"multiple_subject": "Your overdue tasks",
"multiple_message": "You have the following overdue tasks:",
"overdue_since": "overdue since %[1]s",
"overdue_now": "overdue now"
"overdue_since": "since %[1]s",
"overdue_now": "now",
"overdue": "overdue %[1]s"
}
},
"project": {

View File

@ -209,12 +209,11 @@ func (n *TeamMemberAddedNotification) Name() string {
}
func getOverdueSinceString(until time.Duration, language string) (overdueSince string) {
overdueSince = i18n.T(language, "notifications.task.overdue.overdue_since", utils.HumanizeDuration(until, language))
if until == 0 {
overdueSince = i18n.T(language, "notifications.task.overdue.overdue_now")
return i18n.T(language, "notifications.task.overdue.overdue_now")
}
return
return i18n.T(language, "notifications.task.overdue.overdue_since", utils.HumanizeDuration(until, language))
}
// UndoneTaskOverdueNotification represents a UndoneTaskOverdueNotification notification
@ -268,7 +267,7 @@ func (n *UndoneTasksOverdueNotification) ToMail(lang string) *notifications.Mail
overdueLine := ""
for _, task := range sortedTasks {
until := time.Until(task.DueDate).Round(1*time.Hour) * -1
overdueLine += `* [` + task.Title + `](` + config.ServicePublicURL.GetString() + "tasks/" + strconv.FormatInt(task.ID, 10) + `) (` + n.Projects[task.ProjectID].Title + `), ` + getOverdueSinceString(until, n.User.Language) + "\n"
overdueLine += `* [` + task.Title + `](` + config.ServicePublicURL.GetString() + "tasks/" + strconv.FormatInt(task.ID, 10) + `) (` + n.Projects[task.ProjectID].Title + `), ` + i18n.T("notifications.task.overdue.overdue", getOverdueSinceString(until, n.User.Language)) + "\n"
}
return notifications.NewMail().