diff --git a/pkg/i18n/lang/en.json b/pkg/i18n/lang/en.json index 97ab3c44c..482522c66 100644 --- a/pkg/i18n/lang/en.json +++ b/pkg/i18n/lang/en.json @@ -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": { diff --git a/pkg/models/notifications.go b/pkg/models/notifications.go index 08732ce4f..f86ae24b0 100644 --- a/pkg/models/notifications.go +++ b/pkg/models/notifications.go @@ -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().