1
0
Fork 0
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:
Frédéric Guillot 2018-01-18 21:53:31 -08:00
parent 6302c3b219
commit bdcc4134fa
7 changed files with 30 additions and 9 deletions

View file

@ -17,11 +17,12 @@ type SessionData struct {
OAuth2State string `json:"oauth2_state"`
FlashMessage string `json:"flash_message"`
FlashErrorMessage string `json:"flash_error_message"`
Language string `json:"language"`
}
func (s SessionData) String() string {
return fmt.Sprintf(`CSRF="%s", "OAuth2State="%s", FlashMessage="%s", "FlashErrorMessage="%s"`,
s.CSRF, s.OAuth2State, s.FlashMessage, s.FlashErrorMessage)
return fmt.Sprintf(`CSRF="%s", "OAuth2State="%s", FlashMessage="%s", FlashErrorMessage="%s", Lang="%s"`,
s.CSRF, s.OAuth2State, s.FlashMessage, s.FlashErrorMessage, s.Language)
}
// Value converts the session data to JSON.
@ -52,5 +53,5 @@ type Session struct {
}
func (s *Session) String() string {
return fmt.Sprintf(`ID="%s", Data="%v"`, s.ID, s.Data)
return fmt.Sprintf(`ID="%s", Data={%v}`, s.ID, s.Data)
}