From 732431773dde1d5990dd2fd0bf6bb55054ba851d Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 18 Mar 2025 18:23:15 +0100 Subject: [PATCH] fix(i18n): remove duplicate api strings --- pkg/i18n/lang/en.json | 12 ++---------- pkg/models/notifications.go | 4 ++-- pkg/modules/migration/handler/notifications.go | 8 ++++---- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/pkg/i18n/lang/en.json b/pkg/i18n/lang/en.json index 8c12b3863..531c9d9fb 100644 --- a/pkg/i18n/lang/en.json +++ b/pkg/i18n/lang/en.json @@ -100,10 +100,7 @@ } }, "project": { - "created": { - "subject": "%[1]s created the project \"%[2]s\"", - "message": "%[1]s created the project \"%[2]s\"" - } + "created": "%[1]s created the project \"%[2]s\"", }, "team": { "member_added": { @@ -129,12 +126,7 @@ "message": "Looks like the move from %[1]s didn't go as planned this time.", "retry": "No worries, though! Just give it another shot by starting over the same way you did before. Sometimes, these hiccups happen because of glitches on %[1]s's end, but trying again often does the trick.", "error": "We bumped into a little error along the way: `%[2]s`.", - "report": "Please drop us a note about this [in the forum](https://community.vikunja.io/) or any of the usual places so that we can take a look at why it failed." - }, - "failed_reported": { - "subject": "The migration from %[1]s to Vikunja has failed", - "message": "Looks like the move from %[1]s didn't go as planned this time.", - "retry": "No worries, though! Just give it another shot by starting over the same way you did before. Sometimes, these hiccups happen because of glitches on %[1]s's end, but trying again often does the trick.", + "report": "Please drop us a note about this [in the forum](https://community.vikunja.io/) or any of the usual places so that we can take a look at why it failed.", "working_on_it": "We've got the error message on our radar and are on it to get it sorted out soon." } }, diff --git a/pkg/models/notifications.go b/pkg/models/notifications.go index e2399592a..07023798b 100644 --- a/pkg/models/notifications.go +++ b/pkg/models/notifications.go @@ -166,8 +166,8 @@ type ProjectCreatedNotification struct { // ToMail returns the mail notification for ProjectCreatedNotification func (n *ProjectCreatedNotification) ToMail(lang string) *notifications.Mail { return notifications.NewMail(). - Subject(i18n.T(lang, "notifications.project.created.subject", n.Doer.GetName(), n.Project.Title)). - Line(i18n.T(lang, "notifications.project.created.message", n.Doer.GetName(), n.Project.Title)). + Subject(i18n.T(lang, "notifications.project.created", n.Doer.GetName(), n.Project.Title)). + Line(i18n.T(lang, "notifications.project.created", n.Doer.GetName(), n.Project.Title)). Action("View Project", config.ServicePublicURL.GetString()+"projects/") } diff --git a/pkg/modules/migration/handler/notifications.go b/pkg/modules/migration/handler/notifications.go index fe2d9945c..5c2633bf0 100644 --- a/pkg/modules/migration/handler/notifications.go +++ b/pkg/modules/migration/handler/notifications.go @@ -61,10 +61,10 @@ func (n *MigrationFailedReportedNotification) ToMail(lang string) *notifications kind := cases.Title(language.English).String(n.MigratorName) return notifications.NewMail(). - Subject(i18n.T(lang, "notifications.migration.failed_reported.subject", kind)). - Line(i18n.T(lang, "notifications.migration.failed_reported.message", kind)). - Line(i18n.T(lang, "notifications.migration.failed_reported.retry", kind)). - Line(i18n.T(lang, "notifications.migration.failed_reported.working_on_it")) + Subject(i18n.T(lang, "notifications.migration.failed.subject", kind)). + Line(i18n.T(lang, "notifications.migration.failed.message", kind)). + Line(i18n.T(lang, "notifications.migration.failed.retry", kind)). + Line(i18n.T(lang, "notifications.migration.failed.working_on_it")) } // ToDB returns the MigrationFailedReportedNotification notification in a format which can be saved in the db