chore(i18n): improve overdue task emails translation
This commit is contained in:
parent
b307041393
commit
c4566fdb53
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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().
|
||||
|
|
|
|||
Loading…
Reference in New Issue