mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Store language in session to show the login page translated
This commit is contained in:
parent
6302c3b219
commit
bdcc4134fa
7 changed files with 30 additions and 9 deletions
|
@ -46,9 +46,10 @@ func (h *Handler) Use(f ControllerFunc) http.Handler {
|
|||
ctx := NewContext(r, h.store, h.router, h.translator)
|
||||
request := NewRequest(r)
|
||||
response := NewResponse(w, r, h.template)
|
||||
language := ctx.UserLanguage()
|
||||
|
||||
if ctx.IsAuthenticated() {
|
||||
h.template.SetLanguage(ctx.UserLanguage())
|
||||
if language != "" {
|
||||
h.template.SetLanguage(language)
|
||||
} else {
|
||||
h.template.SetLanguage("en_US")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue