diff options
author | Unknwon <u@gogs.io> | 2015-03-18 06:37:44 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-03-18 06:37:44 -0400 |
commit | e6cf83b8c0202ca256ce1b5aaa26459aaaa6532a (patch) | |
tree | a64d8d45372a266650b4b3540d4d04c3418b0227 /cmd | |
parent | deee2d5fa848106db3f00dcb33490dc9b5b61e29 (diff) | |
download | gitea-e6cf83b8c0202ca256ce1b5aaa26459aaaa6532a.tar.gz gitea-e6cf83b8c0202ca256ce1b5aaa26459aaaa6532a.zip |
Put default config into binary
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/web.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/cmd/web.go b/cmd/web.go index a06f5b85ed..f02a98313e 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -34,6 +34,7 @@ import ( "github.com/gogits/gogs/modules/auth/apiv1" "github.com/gogits/gogs/modules/avatar" "github.com/gogits/gogs/modules/base" + "github.com/gogits/gogs/modules/bindata" "github.com/gogits/gogs/modules/git" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/middleware" @@ -82,7 +83,7 @@ func checkVersion() { {"github.com/macaron-contrib/binding", binding.Version, "0.0.6"}, {"github.com/macaron-contrib/cache", cache.Version, "0.0.7"}, {"github.com/macaron-contrib/csrf", csrf.Version, "0.0.3"}, - {"github.com/macaron-contrib/i18n", i18n.Version, "0.0.5"}, + {"github.com/macaron-contrib/i18n", i18n.Version, "0.0.7"}, {"github.com/macaron-contrib/session", session.Version, "0.1.6"}, {"gopkg.in/ini.v1", ini.Version, "1.2.0"}, } @@ -123,9 +124,18 @@ func newMacaron() *macaron.Macaron { Funcs: []template.FuncMap{base.TemplateFuncs}, IndentJSON: macaron.Env != macaron.PROD, })) + + localeNames, err := bindata.AssetDir("conf/locale") + if err != nil { + log.Fatal(4, "Fail to list locale files: %v", err) + } + localFiles := make(map[string][]byte) + for _, name := range localeNames { + localFiles[name] = bindata.MustAsset("conf/locale/" + name) + } m.Use(i18n.I18n(i18n.Options{ SubURL: setting.AppSubUrl, - Directory: path.Join(setting.ConfRootPath, "locale"), + Files: localFiles, CustomDirectory: path.Join(setting.CustomPath, "conf/locale"), Langs: setting.Langs, Names: setting.Names, |