提交 c3819e32 编写于 作者: J Joway 提交者: Christoph Held

support-force-language (#2402)

上级 788800fa
......@@ -83,7 +83,10 @@ func (handler *LocaleHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
// we want a different index.html (for the right locale) to be served when the page refreshes.
w.Header().Add("Cache-Control", "no-store")
}
acceptLanguage := r.Header.Get("Accept-Language")
acceptLanguage := os.Getenv("ACCEPT_LANGUAGE")
if acceptLanguage == "" {
acceptLanguage = r.Header.Get("Accept-Language")
}
dirName := handler.determineLocalizedDir(acceptLanguage)
http.FileServer(http.Dir(dirName)).ServeHTTP(w, r)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册