donate
This commit is contained in:
1 parent
e240dfbafe
commit
b8ced2e1c3
10 files changed
+326
-5
No files matched your search
@@ -154,7 +154,7 @@ func (c BaseController) E404() revel.Result {
|
||||
}
|
||||
|
||||
// 设置本地
|
||||
func (c BaseController) SetLocale() {
|
||||
func (c BaseController) SetLocale() string {
|
||||
locale := string(c.Request.Locale) // zh-CN
|
||||
lang := locale
|
||||
if strings.Contains(locale, "-") {
|
||||
@@ -165,6 +165,7 @@ func (c BaseController) SetLocale() {
|
||||
lang = "en";
|
||||
}
|
||||
c.RenderArgs["locale"] = lang;
|
||||
return lang
|
||||
}
|
||||
|
||||
// 设置userInfo
|
||||
|
||||
@@ -17,9 +17,9 @@ func (c Index) Index() revel.Result {
|
||||
c.SetUserInfo()
|
||||
c.RenderArgs["title"] = "leanote"
|
||||
c.RenderArgs["openRegister"] = openRegister
|
||||
c.SetLocale()
|
||||
lang := c.SetLocale()
|
||||
|
||||
return c.RenderTemplate("home/index.html");
|
||||
return c.RenderTemplate("home/index_" + lang + ".html");
|
||||
}
|
||||
|
||||
// 建议
|
||||
|
||||
Reference in new issue
Block a user