From 3e4cdccf6bfe1904c97204b65c3143414a3c725d Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 5 Aug 2015 15:24:26 +0800 Subject: milestone: create page --- modules/setting/setting.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules/setting') diff --git a/modules/setting/setting.go b/modules/setting/setting.go index c39fab43..7f9d9908 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -134,6 +134,7 @@ var ( // I18n settings. Langs, Names []string + dateLangs map[string]string // Other settings. ShowFooterBranding bool @@ -148,6 +149,14 @@ var ( HasRobotsTxt bool ) +func DateLang(lang string) string { + name, ok := dateLangs[lang] + if ok { + return name + } + return "en" +} + func init() { IsWindows = runtime.GOOS == "windows" log.NewLogger(0, "console", `{"level": 0}`) @@ -353,6 +362,7 @@ func NewConfigContext() { Langs = Cfg.Section("i18n").Key("LANGS").Strings(",") Names = Cfg.Section("i18n").Key("NAMES").Strings(",") + dateLangs = Cfg.Section("i18n.datelang").KeysHash() ShowFooterBranding = Cfg.Section("other").Key("SHOW_FOOTER_BRANDING").MustBool() -- cgit v1.2.3