mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Make use of printer.Print when possible
This commit is contained in:
parent
b4ed17fbac
commit
5a7d6f8997
8 changed files with 22 additions and 22 deletions
|
@ -33,7 +33,7 @@ func (h *handler) refreshCategory(w http.ResponseWriter, r *http.Request) int64
|
|||
|
||||
// Avoid accidental and excessive refreshes.
|
||||
if time.Now().UTC().Unix()-request.LastForceRefresh(r) < 1800 {
|
||||
sess.NewFlashErrorMessage(printer.Printf("alert.too_many_feeds_refresh"))
|
||||
sess.NewFlashErrorMessage(printer.Print("alert.too_many_feeds_refresh"))
|
||||
} else {
|
||||
// We allow the end-user to force refresh all its feeds in this category
|
||||
// without taking into consideration the number of errors.
|
||||
|
@ -58,7 +58,7 @@ func (h *handler) refreshCategory(w http.ResponseWriter, r *http.Request) int64
|
|||
go h.pool.Push(jobs)
|
||||
|
||||
sess.SetLastForceRefresh()
|
||||
sess.NewFlashMessage(printer.Printf("alert.background_feed_refresh"))
|
||||
sess.NewFlashMessage(printer.Print("alert.background_feed_refresh"))
|
||||
}
|
||||
|
||||
return categoryID
|
||||
|
|
|
@ -63,7 +63,7 @@ func (h *handler) refreshAllFeeds(w http.ResponseWriter, r *http.Request) {
|
|||
go h.pool.Push(jobs)
|
||||
|
||||
sess.SetLastForceRefresh()
|
||||
sess.NewFlashMessage(printer.Printf("alert.background_feed_refresh"))
|
||||
sess.NewFlashMessage(printer.Print("alert.background_feed_refresh"))
|
||||
}
|
||||
|
||||
html.Redirect(w, r, route.Path(h.router, "feeds"))
|
||||
|
|
|
@ -39,7 +39,7 @@ func (h *handler) pocketAuthorize(w http.ResponseWriter, r *http.Request) {
|
|||
slog.Any("user_id", user.ID),
|
||||
slog.Any("error", err),
|
||||
)
|
||||
sess.NewFlashErrorMessage(printer.Printf("error.pocket_request_token"))
|
||||
sess.NewFlashErrorMessage(printer.Print("error.pocket_request_token"))
|
||||
html.Redirect(w, r, route.Path(h.router, "integrations"))
|
||||
return
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ func (h *handler) pocketCallback(w http.ResponseWriter, r *http.Request) {
|
|||
slog.Any("user_id", user.ID),
|
||||
slog.Any("error", err),
|
||||
)
|
||||
sess.NewFlashErrorMessage(printer.Printf("error.pocket_access_token"))
|
||||
sess.NewFlashErrorMessage(printer.Print("error.pocket_access_token"))
|
||||
html.Redirect(w, r, route.Path(h.router, "integrations"))
|
||||
return
|
||||
}
|
||||
|
@ -85,6 +85,6 @@ func (h *handler) pocketCallback(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
sess.NewFlashMessage(printer.Printf("alert.pocket_linked"))
|
||||
sess.NewFlashMessage(printer.Print("alert.pocket_linked"))
|
||||
html.Redirect(w, r, route.Path(h.router, "integrations"))
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ func (h *handler) updateIntegration(w http.ResponseWriter, r *http.Request) {
|
|||
integrationForm.Merge(integration)
|
||||
|
||||
if integration.FeverUsername != "" && h.store.HasDuplicateFeverUsername(user.ID, integration.FeverUsername) {
|
||||
sess.NewFlashErrorMessage(printer.Printf("error.duplicate_fever_username"))
|
||||
sess.NewFlashErrorMessage(printer.Print("error.duplicate_fever_username"))
|
||||
html.Redirect(w, r, route.Path(h.router, "integrations"))
|
||||
return
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ func (h *handler) updateIntegration(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
if integration.GoogleReaderUsername != "" && h.store.HasDuplicateGoogleReaderUsername(user.ID, integration.GoogleReaderUsername) {
|
||||
sess.NewFlashErrorMessage(printer.Printf("error.duplicate_googlereader_username"))
|
||||
sess.NewFlashErrorMessage(printer.Print("error.duplicate_googlereader_username"))
|
||||
html.Redirect(w, r, route.Path(h.router, "integrations"))
|
||||
return
|
||||
}
|
||||
|
@ -85,6 +85,6 @@ func (h *handler) updateIntegration(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
sess.NewFlashMessage(printer.Printf("alert.prefs_saved"))
|
||||
sess.NewFlashMessage(printer.Print("alert.prefs_saved"))
|
||||
html.Redirect(w, r, route.Path(h.router, "integrations"))
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ func (h *handler) oauth2Callback(w http.ResponseWriter, r *http.Request) {
|
|||
slog.String("oauth2_provider", provider),
|
||||
slog.String("oauth2_profile_id", profile.ID),
|
||||
)
|
||||
sess.NewFlashErrorMessage(printer.Printf("error.duplicate_linked_account"))
|
||||
sess.NewFlashErrorMessage(printer.Print("error.duplicate_linked_account"))
|
||||
html.Redirect(w, r, route.Path(h.router, "settings"))
|
||||
return
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ func (h *handler) oauth2Callback(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
sess.NewFlashMessage(printer.Printf("alert.account_linked"))
|
||||
sess.NewFlashMessage(printer.Print("alert.account_linked"))
|
||||
html.Redirect(w, r, route.Path(h.router, "settings"))
|
||||
return
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ func (h *handler) oauth2Callback(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
if h.store.UserExists(profile.Username) {
|
||||
html.BadRequest(w, r, errors.New(printer.Printf("error.user_already_exists")))
|
||||
html.BadRequest(w, r, errors.New(printer.Print("error.user_already_exists")))
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ func (h *handler) oauth2Unlink(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
if !hasPassword {
|
||||
sess.NewFlashErrorMessage(printer.Printf("error.unlink_account_without_password"))
|
||||
sess.NewFlashErrorMessage(printer.Print("error.unlink_account_without_password"))
|
||||
html.Redirect(w, r, route.Path(h.router, "settings"))
|
||||
return
|
||||
}
|
||||
|
@ -58,6 +58,6 @@ func (h *handler) oauth2Unlink(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
sess.NewFlashMessage(printer.Printf("alert.account_unlinked"))
|
||||
sess.NewFlashMessage(printer.Print("alert.account_unlinked"))
|
||||
html.Redirect(w, r, route.Path(h.router, "settings"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue