mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
the language of password reset email set to client language if user language is not set
This commit is contained in:
@@ -13,6 +13,9 @@ const textualTokenFieldKey = "TOKEN_STRING"
|
||||
const tokenClaimsFieldKey = "TOKEN_CLAIMS"
|
||||
const responseErrorFieldKey = "RESPONSE_ERROR"
|
||||
|
||||
// AcceptLanguageHeaderName represents the header name of accept language
|
||||
const AcceptLanguageHeaderName = "Accept-Language"
|
||||
|
||||
// ClientTimezoneOffsetHeaderName represents the header name of client timezone offset
|
||||
const ClientTimezoneOffsetHeaderName = "X-Timezone-Offset"
|
||||
|
||||
@@ -81,6 +84,13 @@ func (c *Context) GetCurrentUid() int64 {
|
||||
return claims.Uid
|
||||
}
|
||||
|
||||
// GetClientLocale returns the client locale name
|
||||
func (c *Context) GetClientLocale() string {
|
||||
value := c.GetHeader(AcceptLanguageHeaderName)
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
// GetClientTimezoneOffset returns the client timezone offset
|
||||
func (c *Context) GetClientTimezoneOffset() (int16, error) {
|
||||
value := c.GetHeader(ClientTimezoneOffsetHeaderName)
|
||||
|
||||
Reference in New Issue
Block a user