From c7d3c49daa8bfd1e459bc20131a7aa0c371a8b12 Mon Sep 17 00:00:00 2001 From: akuma06 Date: Sun, 21 May 2017 01:22:07 +0200 Subject: [PATCH] fix --- router/user_handler.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/router/user_handler.go b/router/user_handler.go index 805212f8..57ee1afc 100644 --- a/router/user_handler.go +++ b/router/user_handler.go @@ -326,13 +326,14 @@ func UserNotificationsHandler(w http.ResponseWriter, r *http.Request) { currentUser := GetUser(r) if currentUser.ID > 0 { messages := msg.GetMessages(r) - T := languages.SetTranslationFromRequest(viewProfileNotifTemplate, r) + Ts, _ := languages.GetTfuncAndLanguageFromRequest(r) + T := languages.GetTfuncFromRequest(r) if r.URL.Query()["clear"] != nil { notifierService.DeleteAllNotifications(currentUser.ID) - messages.AddInfo("infos", T("notifications_cleared")) + messages.AddInfo("infos", Ts("notifications_cleared")) currentUser.Notifications = []model.Notification{} } - htv := UserProfileNotifVariables{messages.GetAllInfos(), NewSearchForm(), NewNavigation(), currentUser, r.URL, mux.CurrentRoute(r)} + htv := UserProfileNotifVariables{messages.GetAllInfos(), NewSearchForm(), NewNavigation(), T, currentUser, r.URL, mux.CurrentRoute(r)} err := viewProfileNotifTemplate.ExecuteTemplate(w, "index.html", htv) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError)