1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 05:09:42 +02:00

i18n server-side strings

This commit is contained in:
Harvey Kandola 2022-03-16 16:58:42 -04:00
parent f4a1350a41
commit df534f72fa
11 changed files with 59 additions and 131 deletions

View file

@ -22,6 +22,7 @@ import (
"time"
"github.com/documize/community/core/env"
"github.com/documize/community/core/i18n"
"github.com/documize/community/core/request"
"github.com/documize/community/core/response"
"github.com/documize/community/domain"
@ -191,6 +192,10 @@ func (m *middleware) Authorize(w http.ResponseWriter, r *http.Request, next http
rc.GlobalAdmin = u.GlobalAdmin
rc.ViewUsers = u.ViewUsers
rc.Fullname = u.Fullname()
rc.Locale = u.Locale
if len(rc.Locale) == 0 {
u.Locale = i18n.DefaultLocale
}
// We send back with every HTTP request/response cycle the latest
// user state. This helps client-side applications to detect changes in