diff options
author | Unknwon <u@gogs.io> | 2015-08-05 15:24:26 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-05 15:24:26 +0800 |
commit | 3e4cdccf6bfe1904c97204b65c3143414a3c725d (patch) | |
tree | 72df1740ed28e2fbd01557fa14665842fab6423d /modules/setting | |
parent | ce4dcf1e83d19ac0eb54ff059a52fca7c94308f8 (diff) | |
download | gitea-3e4cdccf6bfe1904c97204b65c3143414a3c725d.tar.gz gitea-3e4cdccf6bfe1904c97204b65c3143414a3c725d.zip |
milestone: create page
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index c39fab4328..7f9d9908f8 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() |