diff --git a/pkg/i18n/lang/en.json b/pkg/i18n/lang/en.json index 5cefcea98..8c12b3863 100644 --- a/pkg/i18n/lang/en.json +++ b/pkg/i18n/lang/en.json @@ -118,6 +118,26 @@ "availability": "The download will be available for the next 7 days." } }, + "migration": { + "done": { + "subject": "The migration from %[1]s to Vikunja was completed", + "imported": "Vikunja has imported all lists/projects, tasks, notes, reminders and files from %[1]s you have access to.", + "have_fun": "Have fun with your new (old) projects!" + }, + "failed": { + "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.", + "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.", + "working_on_it": "We've got the error message on our radar and are on it to get it sorted out soon." + } + }, "common": { "have_nice_day": "Have a nice day!", "copy_url": "If the button above doesn't work, copy the url below and paste it in your browser's address bar:" diff --git a/pkg/modules/migration/handler/notifications.go b/pkg/modules/migration/handler/notifications.go index bc399d834..fe2d9945c 100644 --- a/pkg/modules/migration/handler/notifications.go +++ b/pkg/modules/migration/handler/notifications.go @@ -21,6 +21,7 @@ import ( "golang.org/x/text/language" "code.vikunja.io/api/pkg/config" + "code.vikunja.io/api/pkg/i18n" "code.vikunja.io/api/pkg/notifications" ) @@ -34,10 +35,10 @@ func (n *MigrationDoneNotification) ToMail(lang string) *notifications.Mail { kind := cases.Title(language.English).String(n.MigratorName) return notifications.NewMail(). - Subject("The migration from "+kind+" to Vikunja was completed"). - Line("Vikunja has imported all lists/projects, tasks, notes, reminders and files from "+kind+" you have access to."). + Subject(i18n.T(lang, "notifications.migration.done.subject", kind)). + Line(i18n.T(lang, "notifications.migration.done.imported", kind)). Action("View your imported projects in Vikunja", config.ServicePublicURL.GetString()). - Line("Have fun with your new (old) projects!") + Line(i18n.T(lang, "notifications.migration.done.have_fun")) } // ToDB returns the MigrationDoneNotification notification in a format which can be saved in the db @@ -60,10 +61,10 @@ func (n *MigrationFailedReportedNotification) ToMail(lang string) *notifications kind := cases.Title(language.English).String(n.MigratorName) return notifications.NewMail(). - Subject("The migration from " + kind + " to Vikunja has failed"). - Line("Looks like the move from " + kind + " didn't go as planned this time."). - Line("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 " + kind + "'s end, but trying again often does the trick."). - Line("We've got the error message on our radar and are on it to get it sorted out soon.") + 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")) } // ToDB returns the MigrationFailedReportedNotification notification in a format which can be saved in the db @@ -87,11 +88,11 @@ func (n *MigrationFailedNotification) ToMail(lang string) *notifications.Mail { kind := cases.Title(language.English).String(n.MigratorName) return notifications.NewMail(). - Subject("The migration from " + kind + " to Vikunja has failed"). - Line("Looks like the move from " + kind + " didn't go as planned this time."). - Line("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 " + kind + "'s end, but trying again often does the trick."). - Line("We bumped into a little error along the way: `" + n.Error.Error() + "`."). - Line("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.") + 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.error", n.Error.Error())). + Line(i18n.T(lang, "notifications.migration.failed.report")) } // ToDB returns the MigrationFailedNotification notification in a format which can be saved in the db