mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-22 08:34:05 +09:00
Support setting cookie domain (#6288)
Signed-off-by: Tamal Saha <tamal@appscode.com>
This commit is contained in:
committed by
techknowlogick
parent
d95237b561
commit
2102f9d92d
6
vendor/github.com/go-macaron/i18n/i18n.go
generated
vendored
6
vendor/github.com/go-macaron/i18n/i18n.go
generated
vendored
@ -26,7 +26,7 @@ import (
|
||||
"gopkg.in/macaron.v1"
|
||||
)
|
||||
|
||||
const _VERSION = "0.3.0"
|
||||
const _VERSION = "0.4.0"
|
||||
|
||||
func Version() string {
|
||||
return _VERSION
|
||||
@ -96,6 +96,8 @@ type Options struct {
|
||||
TmplName string
|
||||
// Configuration section name. Default is "i18n".
|
||||
Section string
|
||||
// Domain used for `lang` cookie. Default is ""
|
||||
CookieDomain string
|
||||
}
|
||||
|
||||
func prepareOptions(options []Options) Options {
|
||||
@ -193,7 +195,7 @@ func I18n(options ...Options) macaron.Handler {
|
||||
|
||||
// Save language information in cookies.
|
||||
if !hasCookie {
|
||||
ctx.SetCookie("lang", curLang.Lang, 1<<31-1, "/"+strings.TrimPrefix(opt.SubURL, "/"))
|
||||
ctx.SetCookie("lang", curLang.Lang, 1<<31-1, "/"+strings.TrimPrefix(opt.SubURL, "/"), opt.CookieDomain)
|
||||
}
|
||||
|
||||
restLangs := make([]LangType, 0, i18n.Count()-1)
|
||||
|
Reference in New Issue
Block a user